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

Author(s):
Adrian Cole
 
 public class DriveInfo extends Drive {
    public static class Builder extends Drive.Builder {
 
       protected DriveStatus status;
       protected String user;
       protected Set<Stringclaimed = ImmutableSet.of();
       @Nullable
       protected String encryptionCipher;
       @Nullable
       protected String imaging;
       protected DriveMetrics metrics;
       private Boolean autoexpanding;
       private Integer bits;
       private String description;
       private Set<StringdriveType = ImmutableSet.of();
       private String encryptionKey;
       private Boolean free;
       private String installNotes;
       private String os;
       private DriveType type;
       private URI url;
 
       public Builder status(DriveStatus status) {
          this. = status;
          return this;
       }
 
       public Builder user(String user) {
          this. = user;
          return this;
       }
 
       public Builder claimed(Iterable<Stringclaimed) {
          this. = ImmutableSet.copyOf(checkNotNull(claimed"claimed"));
          return this;
       }
 
       public Builder imaging(String imaging) {
          this. = imaging;
          return this;
       }
 
       public Builder metrics(DriveMetrics metrics) {
          this. = metrics;
          return this;
       }
 
       public Builder encryptionCipher(String encryptionCipher) {
          this. = encryptionCipher;
          return this;
       }
 
       public Builder autoexpanding(Boolean autoexpanding) {
          this. = autoexpanding;
          return this;
       }
 
       public Builder bits(Integer bits) {
          this. = bits;
          return this;
       }
 
       public Builder description(String description) {
          this. = description;
          return this;
       }
      public Builder driveType(Iterable<StringdriveType) {
         this. = ImmutableSet.copyOf(checkNotNull(driveType"driveType"));
         return this;
      }
      public Builder encryptionKey(String encryptionKey) {
         this. = encryptionKey;
         return this;
      }
      public Builder free(Boolean free) {
         this. = free;
         return this;
      }
      public Builder installNotes(String installNotes) {
         this. = installNotes;
         return this;
      }
      public Builder os(String os) {
         this. = os;
         return this;
      }
      public Builder type(DriveType type) {
         this. = type;
         return this;
      }
      public Builder url(URI url) {
         this. = url;
         return this;
      }

      
      @Override
      public Builder claimType(ClaimType claimType) {
         return Builder.class.cast(super.claimType(claimType));
      }

      
      @Override
      public Builder readers(Iterable<Stringreaders) {
         return Builder.class.cast(super.readers(readers));
      }

      
      @Override
      public Builder size(long size) {
         return Builder.class.cast(super.size(size));
      }

      
      @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 static Builder fromDriveInfo(DriveInfo in) {
         return new Builder().uuid(in.getUuid()).name(in.getName()).size(in.getSize()).claimType(in.getClaimType())
               .readers(in.getReaders()).use(in.getUse()).status(in.getStatus()).user(in.getUser())
               .claimed(in.getClaimed()).encryptionCipher(in.getEncryptionCipher()).imaging(in.getImaging())
               .metrics(in.getMetrics()).autoexpanding(in.getAutoexpanding()).bits(in.getBits())
               .description(in.getDescription()).encryptionKey(in.getEncryptionKey()).free(in.getFree())
               .installNotes(in.getInstallNotes()).type(in.getType()).url(in.getUrl());
      }

      
      @Override
      public DriveInfo build() {
         return new DriveInfo(,
               ,
               );
      }
   }
   protected final DriveStatus status;
   protected final String user;
   protected final Set<Stringclaimed;
   protected final String encryptionCipher;
   protected final String imaging;
   protected final DriveMetrics metrics;
   private final Boolean autoexpanding;
   private final Integer bits;
   private final String description;
   private final ImmutableSet<StringdriveType;
   private final String encryptionKey;
   private final Boolean free;
   private final String installNotes;
   private final String os;
   private final DriveType type;
   private final URI url;
   public DriveInfo(String uuidString namelong sizeClaimType claimTypeIterable<Stringreaders,
         Iterable<StringuseDriveStatus statusString userSet<StringclaimedString encryptionCipher,
         String imagingDriveMetrics metricsBoolean autoexpandingInteger bitsString description,
         Iterable<StringdriveTypeString encryptionKeyBoolean freeString installNotesString os,
         DriveType typeURI url) {
      super(uuidnamesizeclaimTypereadersuse);
      this. = status;
      this. = user;
      this. = ImmutableSet.copyOf(checkNotNull(claimed"claimed"));
      this. = encryptionCipher;
      this. = imaging;
      this. = checkNotNull(metrics"metrics");
      this. = autoexpanding;
      this. = bits;
      this. = description;
      this. = ImmutableSet.copyOf(driveType);
      this. = encryptionKey;
      this. = free;
      this. = installNotes;
      this. = os;
      this. = type;
      this. = url;
   }

   

Returns:
current status of the drive
   public DriveStatus getStatus() {
      return ;
   }

   

Returns:
owner of the drive
   public String getUser() {
      return ;
   }

   

Returns:
if drive is in use by a server, values are the server uuids
   public Set<StringgetClaimed() {
      return ;
   }

   

Returns:
either 'none' or 'aes-xts-plain' (the default)
   public String getEncryptionCipher() {
      return ;
   }

   

Returns:
percentage completed of drive imaging if this is underway, or 'queued' if waiting for another imaging operation to complete first
   public String getImaging() {
      return ;
   }

   

Returns:
i/o and request metrics for read and write ops
   public DriveMetrics getMetrics() {
      return ;
   }
   // TODO
   public Boolean getAutoexpanding() {
      return ;
   }
   // TODO
   public Integer getBits() {
      return ;
   }
   // TODO undocumented
   public String getDescription() {
      return ;
   }
   // TODO
   public Set<StringgetDriveType() {
      return ;
   }
   // TODO
   public String getEncryptionKey() {
      return ;
   }
   // TODO
   public Boolean getFree() {
      return ;
   }
   // TODO
   public String getInstallNotes() {
      return ;
   }
   // TODO
   public String getOs() {
      return ;
   }
   // TODO
   public DriveType getType() {
      return ;
   }
   public URI getUrl() {
      return ;
   }
   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 + (( == null) ? 0 : .hashCode());
      result = prime * result + (( == null) ? 0 : .hashCode());
      result = prime * result + (( == null) ? 0 : .hashCode());
      result = prime * result + (( == null) ? 0 : .hashCode());
      result = prime * result + (( == null) ? 0 : .hashCode());
      result = prime * result + (( == null) ? 0 : .hashCode());
      result = prime * result + (( == null) ? 0 : .hashCode());
      result = prime * result + (( == null) ? 0 : .hashCode());
      result = prime * result + (( == null) ? 0 : .hashCode());
      result = prime * result + (( == null) ? 0 : .hashCode());
      result = prime * result + (( == null) ? 0 : .hashCode());
      result = prime * result + (( == null) ? 0 : .hashCode());
      result = prime * result + (( == null) ? 0 : .hashCode());
      result = prime * result + (( == null) ? 0 : .hashCode());
      return result;
   }
   public boolean equals(Object obj) {
      if (this == obj)
         return true;
      if (!super.equals(obj))
         return false;
      if (getClass() != obj.getClass())
         return false;
      DriveInfo other = (DriveInfoobj;
      if ( == null) {
         if (other.autoexpanding != null)
            return false;
      } else if (!.equals(other.autoexpanding))
         return false;
      if ( == null) {
         if (other.bits != null)
            return false;
      } else if (!.equals(other.bits))
         return false;
      if ( == null) {
         if (other.claimed != null)
            return false;
      } else if (!.equals(other.claimed))
         return false;
      if ( == null) {
         if (other.description != null)
            return false;
      } else if (!.equals(other.description))
         return false;
      if ( == null) {
         if (other.driveType != null)
            return false;
      } else if (!.equals(other.driveType))
         return false;
      if ( == null) {
         if (other.encryptionCipher != null)
            return false;
      } else if (!.equals(other.encryptionCipher))
         return false;
      if ( == null) {
         if (other.encryptionKey != null)
            return false;
      } else if (!.equals(other.encryptionKey))
         return false;
      if ( == null) {
         if (other.free != null)
            return false;
      } else if (!.equals(other.free))
         return false;
      if ( == null) {
         if (other.imaging != null)
            return false;
      } else if (!.equals(other.imaging))
         return false;
      if ( == null) {
         if (other.installNotes != null)
            return false;
      } else if (!.equals(other.installNotes))
         return false;
      if ( == null) {
         if (other.metrics != null)
            return false;
      } else if (!.equals(other.metrics))
         return false;
      if ( == null) {
         if (other.os != null)
            return false;
      } else if (!.equals(other.os))
         return false;
      if ( != other.status)
         return false;
      if ( != other.type)
         return false;
      if ( == null) {
         if (other.url != null)
            return false;
      } else if (!.equals(other.url))
         return false;
      if ( == null) {
         if (other.user != null)
            return false;
      } else if (!.equals(other.user))
         return false;
      return true;
   }
   public String toString() {
      return "[size=" +  + ", claimType=" +  + ", readers=" +  + ", uuid=" +  + ", name="
            +  + ", use=" +  + ", status=" +  + ", user=" +  + ", claimed=" + 
            + ", encryptionCipher=" +  + ", imaging=" +  + ", metrics=" +  + "]";
   }
New to GrepCode? Check out our FAQ X