Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.jclouds.openstack.swift.v1.domain;
  
  import static com.google.common.base.Objects.equal;
  import static com.google.common.base.Objects.toStringHelper;
  import static com.google.common.base.Preconditions.checkNotNull;
  
  
retrieve a list of existing storage containers ordered by name. The sort order for the name is based on a binary comparison, a single built-in collating sequence that compares string data using SQLite's memcmp() function, regardless of text encoding.

Author(s):
Adrian Cole
See also:
api doc
 
 public class Container implements Comparable<Container> {
 
    public static Builder builder() {
       return new Builder();
    }
 
    public Builder toBuilder() {
       return builder().fromContainer(this);
    }
 
    public static class Builder {
       protected String name;
       protected int count;
       protected int bytes;

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

      
 
       public Builder count(int count) {
          this. = count;
          return this;
       }

      
 
       public Builder bytes(int bytes) {
          this. = bytes;
          return this;
       }
 
       public Container build() {
          return new Container();
       }
 
       public Builder fromContainer(Container from) {
          return name(from.getName()).count(from.getCount()).bytes(from.getBytes());
       }
    }
   
    protected String name;
    protected int count;
    protected int bytes;
 
    @ConstructorProperties({"name""count""bytes"})
    protected Container(String nameint countint bytes) {
       this. = checkNotNull(name"name");
       this. = count;
       this. = bytes;
    }

   

Returns:
the name of the container
 
    public String getName() {
       return ;
    }

   

Returns:
the number of objects in the container
 
    public int getCount() {
       return ;
    }

   

Returns:
the total bytes stored in this container
 
   public int getBytes() {
      return ;
   }
   public boolean equals(Object object) {
      if (this == object) {
         return true;
      }
      if (object instanceof Container) {
         final Container other = Container.class.cast(object);
         return equal(getName(), other.getName()) && equal(getCount(), other.getCount())
                  && equal(getBytes(), other.getBytes());
      } else {
         return false;
      }
   }
   public int hashCode() {
      return Objects.hashCode(getName(), getCount(), getBytes());
   }
   public String toString() {
      return string().toString();
   }
   protected ToStringHelper string() {
      return toStringHelper("").add("name"getName()).add("count"getCount()).add("bytes"getBytes());
   }
   public int compareTo(Container that) {
      if (that == null)
         return 1;
      if (this == that)
         return 0;
      return this.getName().compareTo(that.getName());
   }
New to GrepCode? Check out our FAQ X