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.cloudsigma.domain;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 
 import java.util.Set;
 
 

Author(s):
Adrian Cole
 
 public class Drive extends Item {
    public static class Builder extends Item.Builder {
       protected long size;
       protected ClaimType claimType = .;
       protected Set<Stringreaders = ImmutableSet.of();
 
       public Builder claimType(ClaimType claimType) {
          this. = claimType;
          return this;
       }
 
       public Builder readers(Iterable<Stringreaders) {
          this. = ImmutableSet.copyOf(checkNotNull(readers"readers"));
          return this;
       }
 
       public Builder size(long size) {
          this. = size;
          return this;
       }

      
 
       @Override
       public Builder uuid(String uuid) {
          return Builder.class.cast(super.uuid(uuid));
       }

      
 
       @Override
       public Builder name(String name) {
          return Builder.class.cast(super.name(name));
       }

      
 
       @Override
       public Builder use(Iterable<Stringuse) {
          return Builder.class.cast(super.use(use));
       }
 
       public Drive build() {
          return new Drive();
       }
 
       @Override
       public int hashCode() {
          final int prime = 31;
          int result = super.hashCode();
          result = prime * result + (( == null) ? 0 : .hashCode());
          result = prime * result + (( == null) ? 0 : .hashCode());
          result = prime * result + (int) ( ^ ( >>> 32));
          return result;
       }
 
       @Override
       public boolean equals(Object obj) {
          if (this == obj)
             return true;
          if (!super.equals(obj))
             return false;
          if (getClass() != obj.getClass())
             return false;
         Builder other = (Builderobj;
         if ( != other.claimType)
            return false;
         if ( == null) {
            if (other.readers != null)
               return false;
         } else if (!.equals(other.readers))
            return false;
         if ( != other.size)
            return false;
         return true;
      }
   }
   protected final long size;
   protected final ClaimType claimType;
   protected final Set<Stringreaders;
   public Drive(@Nullable String uuidString namelong size, @Nullable ClaimType claimTypeIterable<Stringreaders,
         Iterable<Stringuse) {
      super(uuidnameuse);
      this. = size;
      this. = checkNotNull(claimType"set claimType to exclusive, not null");
      this. = ImmutableSet.copyOf(checkNotNull(readers"readers"));
   }

   

Returns:
either 'exclusive' (the default) or 'shared' to allow multiple servers to access a drive simultaneously
   public ClaimType getClaimType() {
      return ;
   }

   

Returns:
list of users allowed to read from a drive or 'ffffffff-ffff-ffff-ffff-ffffffffffff' for all users
   public Set<StringgetReaders() {
      return ;
   }

   

Returns:
size of drive in bytes
   public long getSize() {
      return ;
   }
   public int hashCode() {
      final int prime = 31;
      int result = 1;
      result = prime * result + (( == null) ? 0 : .hashCode());
      result = prime * result + (( == null) ? 0 : .hashCode());
      result = prime * result + (( == null) ? 0 : .hashCode());
      result = prime * result + (int) ( ^ ( >>> 32));
      result = prime * result + (( == null) ? 0 : .hashCode());
      return result;
   }
   public boolean equals(Object obj) {
      if (this == obj)
         return true;
      if (obj == null)
         return false;
      if (getClass() != obj.getClass())
         return false;
      Drive other = (Driveobj;
      if ( != other.claimType)
         return false;
      if ( == null) {
         if (other.name != null)
            return false;
      } else if (!.equals(other.name))
         return false;
      if ( == null) {
         if (other.readers != null)
            return false;
      } else if (!.equals(other.readers))
         return false;
      if ( != other.size)
         return false;
      if ( == null) {
         if (other.use != null)
            return false;
      } else if (!.equals(other.use))
         return false;
      return true;
   }
   public String toString() {
      return "[uuid=" +  + ", name=" +  + ", use=" +  + ", size=" +  + ", claimType=" + 
            + ", readers=" +  + "]";
   }
New to GrepCode? Check out our FAQ X