Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to jclouds, Inc. (jclouds) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. jclouds licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package org.jclouds.elb.domain;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 

Author(s):
Adrian Cole
See also:
doc
 
 public class Policy {
 
    public static Builder<?> builder() {
       return new ConcreteBuilder();
    }
 
    public Builder<?> toBuilder() {
       return new ConcreteBuilder().fromPolicy(this);
    }
 
    public static abstract class Builder<T extends Builder<T>> {
       protected abstract T self();
 
       protected String name;
       protected String typeName;
       protected ImmutableMultimap.Builder<StringObjectattributes = ImmutableMultimap.<StringObjectbuilder();

      
 
       public T name(String name) {
          this. = name;
          return self();
       }

      
 
       public T typeName(String typeName) {
          this. = typeName;
          return self();
       }

      
 
       public T attributes(Multimap<StringObjectattributes) {
          this..putAll(checkNotNull(attributes"attributes"));
          return self();
       }

      
 
       public T attribute(String keyObject value) {
          this..put(checkNotNull(key"key"), checkNotNull(value"value"));
          return self();
       }
 
       public Policy build() {
          return new Policy(.build());
       }
 
       public T fromPolicy(Policy in) {
          return this.name(in.getName()).typeName(in.getTypeName()).attributes(in.getAttributes());
       }
    }
 
    private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
       @Override
       protected ConcreteBuilder self() {
          return this;
       }
    }
 
   protected final String name;
   protected final String typeName;
   protected final Multimap<StringObjectattributes;
   protected Policy(String nameString typeNameMultimap<StringObjectattributes) {
      this. = checkNotNull(name"name");
      this. = checkNotNull(typeName"typeName");
      this. = ImmutableMultimap.copyOf(checkNotNull(attributes"attributes"));
   }

   
The name of the policy associated with the LoadBalancer
   public String getName() {
      return ;
   }

   
The name of the policy type associated with the LoadBalancer.
   public String getTypeName() {
      return ;
   }

   
A list of policy attribute description structures. Note that values are either Long, Boolean, or String, depending on AttributeMetadata.getType()
   public Multimap<StringObjectgetAttributes() {
      return ;
   }

   
   public int hashCode() {
      return Objects.hashCode();
   }

   
   public boolean equals(Object obj) {
      if (this == obj)
         return true;
      if (obj == null)
         return false;
      if (getClass() != obj.getClass())
         return false;
      Policy other = (Policyobj;
      return Objects.equal(this.other.name) && Objects.equal(this.other.typeName);
   }

   
   public String toString() {
      return Objects.toStringHelper(this).omitNullValues().add("name").add("typeName")
               .add("attributes").toString();
   }
New to GrepCode? Check out our FAQ X