Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file 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 com.amazonaws.services.storagegateway.model;

Error Code
 
 public enum ErrorCode {
     
     ActivationKeyExpired("ActivationKeyExpired"),
     ActivationKeyInvalid("ActivationKeyInvalid"),
     ActivationKeyNotFound("ActivationKeyNotFound"),
     GatewayInternalError("GatewayInternalError"),
     GatewayNotConnected("GatewayNotConnected"),
     GatewayNotFound("GatewayNotFound"),
     GatewayProxyNetworkConnectionBusy("GatewayProxyNetworkConnectionBusy"),
     AuthenticationFailure("AuthenticationFailure"),
     BandwidthThrottleScheduleNotFound("BandwidthThrottleScheduleNotFound"),
     Blocked("Blocked"),
     CannotExportSnapshot("CannotExportSnapshot"),
     ChapCredentialNotFound("ChapCredentialNotFound"),
     DiskAlreadyAllocated("DiskAlreadyAllocated"),
     DiskDoesNotExist("DiskDoesNotExist"),
     DiskSizeGreaterThanVolumeMaxSize("DiskSizeGreaterThanVolumeMaxSize"),
     DiskSizeLessThanVolumeSize("DiskSizeLessThanVolumeSize"),
     DiskSizeNotGigAligned("DiskSizeNotGigAligned"),
     DuplicateCertificateInfo("DuplicateCertificateInfo"),
     DuplicateSchedule("DuplicateSchedule"),
     EndpointNotFound("EndpointNotFound"),
     IAMNotSupported("IAMNotSupported"),
     InitiatorInvalid("InitiatorInvalid"),
     InitiatorNotFound("InitiatorNotFound"),
     InternalError("InternalError"),
     InvalidGateway("InvalidGateway"),
     InvalidEndpoint("InvalidEndpoint"),
     InvalidParameters("InvalidParameters"),
     InvalidSchedule("InvalidSchedule"),
     LocalStorageLimitExceeded("LocalStorageLimitExceeded"),
     LunAlreadyAllocated("LunAlreadyAllocated "),
     LunInvalid("LunInvalid"),
     MaximumContentLengthExceeded("MaximumContentLengthExceeded"),
     MaximumTapeCartridgeCountExceeded("MaximumTapeCartridgeCountExceeded"),
     MaximumVolumeCountExceeded("MaximumVolumeCountExceeded"),
     NetworkConfigurationChanged("NetworkConfigurationChanged"),
     NoDisksAvailable("NoDisksAvailable"),
     NotImplemented("NotImplemented"),
     NotSupported("NotSupported"),
     OperationAborted("OperationAborted"),
     OutdatedGateway("OutdatedGateway"),
     ParametersNotImplemented("ParametersNotImplemented"),
     RegionInvalid("RegionInvalid"),
     RequestTimeout("RequestTimeout"),
     ServiceUnavailable("ServiceUnavailable"),
     SnapshotDeleted("SnapshotDeleted"),
     SnapshotIdInvalid("SnapshotIdInvalid"),
     SnapshotInProgress("SnapshotInProgress"),
     SnapshotNotFound("SnapshotNotFound"),
     SnapshotScheduleNotFound("SnapshotScheduleNotFound"),
     StagingAreaFull("StagingAreaFull"),
     StorageFailure("StorageFailure"),
     TapeCartridgeNotFound("TapeCartridgeNotFound"),
     TargetAlreadyExists("TargetAlreadyExists"),
     TargetInvalid("TargetInvalid"),
     TargetNotFound("TargetNotFound"),
     UnauthorizedOperation("UnauthorizedOperation"),
     VolumeAlreadyExists("VolumeAlreadyExists"),
     VolumeIdInvalid("VolumeIdInvalid"),
     VolumeInUse("VolumeInUse"),
     VolumeNotFound("VolumeNotFound"),
     VolumeNotReady("VolumeNotReady");
 
     private String value;
 
     private ErrorCode(String value) {
         this. = value;
     }
 
     @Override
     public String toString() {
         return this.;
     }

    
Use this in place of valueOf.

Parameters:
value real value
Returns:
ErrorCode corresponding to the value
    public static ErrorCode fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        
        } else if ("ActivationKeyExpired".equals(value)) {
            return .;
        } else if ("ActivationKeyInvalid".equals(value)) {
            return .;
        } else if ("ActivationKeyNotFound".equals(value)) {
            return .;
        } else if ("GatewayInternalError".equals(value)) {
            return .;
        } else if ("GatewayNotConnected".equals(value)) {
            return .;
        } else if ("GatewayNotFound".equals(value)) {
            return .;
        } else if ("GatewayProxyNetworkConnectionBusy".equals(value)) {
            return .;
        } else if ("AuthenticationFailure".equals(value)) {
            return .;
        } else if ("BandwidthThrottleScheduleNotFound".equals(value)) {
            return .;
        } else if ("Blocked".equals(value)) {
            return .;
        } else if ("CannotExportSnapshot".equals(value)) {
            return .;
        } else if ("ChapCredentialNotFound".equals(value)) {
            return .;
        } else if ("DiskAlreadyAllocated".equals(value)) {
            return .;
        } else if ("DiskDoesNotExist".equals(value)) {
            return .;
        } else if ("DiskSizeGreaterThanVolumeMaxSize".equals(value)) {
            return .;
        } else if ("DiskSizeLessThanVolumeSize".equals(value)) {
            return .;
        } else if ("DiskSizeNotGigAligned".equals(value)) {
            return .;
        } else if ("DuplicateCertificateInfo".equals(value)) {
            return .;
        } else if ("DuplicateSchedule".equals(value)) {
            return .;
        } else if ("EndpointNotFound".equals(value)) {
            return .;
        } else if ("IAMNotSupported".equals(value)) {
            return .;
        } else if ("InitiatorInvalid".equals(value)) {
            return .;
        } else if ("InitiatorNotFound".equals(value)) {
            return .;
        } else if ("InternalError".equals(value)) {
            return .;
        } else if ("InvalidGateway".equals(value)) {
            return .;
        } else if ("InvalidEndpoint".equals(value)) {
            return .;
        } else if ("InvalidParameters".equals(value)) {
            return .;
        } else if ("InvalidSchedule".equals(value)) {
            return .;
        } else if ("LocalStorageLimitExceeded".equals(value)) {
            return .;
        } else if ("LunAlreadyAllocated ".equals(value)) {
            return .;
        } else if ("LunInvalid".equals(value)) {
            return .;
        } else if ("MaximumContentLengthExceeded".equals(value)) {
            return .;
        } else if ("MaximumTapeCartridgeCountExceeded".equals(value)) {
            return .;
        } else if ("MaximumVolumeCountExceeded".equals(value)) {
            return .;
        } else if ("NetworkConfigurationChanged".equals(value)) {
            return .;
        } else if ("NoDisksAvailable".equals(value)) {
            return .;
        } else if ("NotImplemented".equals(value)) {
            return .;
        } else if ("NotSupported".equals(value)) {
            return .;
        } else if ("OperationAborted".equals(value)) {
            return .;
        } else if ("OutdatedGateway".equals(value)) {
            return .;
        } else if ("ParametersNotImplemented".equals(value)) {
            return .;
        } else if ("RegionInvalid".equals(value)) {
            return .;
        } else if ("RequestTimeout".equals(value)) {
            return .;
        } else if ("ServiceUnavailable".equals(value)) {
            return .;
        } else if ("SnapshotDeleted".equals(value)) {
            return .;
        } else if ("SnapshotIdInvalid".equals(value)) {
            return .;
        } else if ("SnapshotInProgress".equals(value)) {
            return .;
        } else if ("SnapshotNotFound".equals(value)) {
            return .;
        } else if ("SnapshotScheduleNotFound".equals(value)) {
            return .;
        } else if ("StagingAreaFull".equals(value)) {
            return .;
        } else if ("StorageFailure".equals(value)) {
            return .;
        } else if ("TapeCartridgeNotFound".equals(value)) {
            return .;
        } else if ("TargetAlreadyExists".equals(value)) {
            return .;
        } else if ("TargetInvalid".equals(value)) {
            return .;
        } else if ("TargetNotFound".equals(value)) {
            return .;
        } else if ("UnauthorizedOperation".equals(value)) {
            return .;
        } else if ("VolumeAlreadyExists".equals(value)) {
            return .;
        } else if ("VolumeIdInvalid".equals(value)) {
            return .;
        } else if ("VolumeInUse".equals(value)) {
            return .;
        } else if ("VolumeNotFound".equals(value)) {
            return .;
        } else if ("VolumeNotReady".equals(value)) {
            return .;
        } else {
            throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
        }
    }
}
    
New to GrepCode? Check out our FAQ X