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

Adrian Cole
See also:
 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) {
          return this;

       public Builder attributeMetadata(AttributeMetadata<?> attributeMetadata) {
          return this;
       public PolicyType build() {
          return new PolicyType(.build());
       public Builder fromPolicyType(PolicyType in) {
    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>(){
         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(;

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