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;
 
 import java.util.Map;
 import java.util.Set;
 

Author(s):
Adrian Cole
See also:
doc
 
 public class PolicyType {
 
    public static Builder builder() {
       return new Builder();
    }
 
    public Builder toBuilder() {
       return builder().fromPolicyType(this);
    }
 
    public static class Builder {
 
       protected String name;
       protected String description;
       protected ImmutableSet.Builder<AttributeMetadata<?>> attributeMetadata = ImmutableSet.<AttributeMetadata<?>> builder();

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

      
 
       public Builder description(String description) {
          this. = description;
          return this;
       }

      
 
       public Builder attributeMetadata(Iterable<AttributeMetadata<?>> attributeMetadata) {
          this..addAll(checkNotNull(attributeMetadata"attributeMetadata"));
          return this;
       }

      
 
       public Builder attributeMetadata(AttributeMetadata<?> attributeMetadata) {
          this..add(checkNotNull(attributeMetadata"attributeMetadata"));
          return this;
       }
 
       public PolicyType build() {
          return new PolicyType(.build());
       }
 
       public Builder fromPolicyType(PolicyType in) {
          return this.name(in.getName()).description(in.getDescription()).attributeMetadata(in.getAttributeMetadata());
       }
    }
 
    protected final String name;
    protected final String description;
    protected final Set<AttributeMetadata<?>> attributeMetadata;
 
   protected PolicyType(String nameString descriptionIterable<AttributeMetadata<?>> attributeMetadata) {
      this. = checkNotNull(name"name");
      this. = checkNotNull(description"description");
      this. = ImmutableSet.copyOf(checkNotNull(attributeMetadata"attributeMetadata"));
   }

   
The name of the policy type.
   public String getName() {
      return ;
   }

   
A human-readable description of the policy type.
   public String getDescription() {
      return ;
   }

   
The description of the policy attributes associated with the LoadBalancer policies defined by the Elastic Load Balancing service.
      return ;
   }
   
   
convenience method

      return Maps.uniqueIndex(new Function<AttributeMetadata<?>, String>(){
         @Override
         public String apply(AttributeMetadata<?> input) {
            return input.getName();
         }
         
      });
   }

   
   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;
      PolicyType other = (PolicyTypeobj;
      return Objects.equal(this.other.name);
   }

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