Beispiel #1
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof RaidArray == false) return false;
    RaidArray other = (RaidArray) obj;
    if (other.getRaidArrayId() == null ^ this.getRaidArrayId() == null) return false;
    if (other.getRaidArrayId() != null
        && other.getRaidArrayId().equals(this.getRaidArrayId()) == false) return false;
    if (other.getInstanceId() == null ^ this.getInstanceId() == null) return false;
    if (other.getInstanceId() != null
        && other.getInstanceId().equals(this.getInstanceId()) == false) return false;
    if (other.getName() == null ^ this.getName() == null) return false;
    if (other.getName() != null && other.getName().equals(this.getName()) == false) return false;
    if (other.getRaidLevel() == null ^ this.getRaidLevel() == null) return false;
    if (other.getRaidLevel() != null && other.getRaidLevel().equals(this.getRaidLevel()) == false)
      return false;
    if (other.getNumberOfDisks() == null ^ this.getNumberOfDisks() == null) return false;
    if (other.getNumberOfDisks() != null
        && other.getNumberOfDisks().equals(this.getNumberOfDisks()) == false) return false;
    if (other.getSize() == null ^ this.getSize() == null) return false;
    if (other.getSize() != null && other.getSize().equals(this.getSize()) == false) return false;
    if (other.getDevice() == null ^ this.getDevice() == null) return false;
    if (other.getDevice() != null && other.getDevice().equals(this.getDevice()) == false)
      return false;
    if (other.getMountPoint() == null ^ this.getMountPoint() == null) return false;
    if (other.getMountPoint() != null
        && other.getMountPoint().equals(this.getMountPoint()) == false) return false;
    if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == null) return false;
    if (other.getAvailabilityZone() != null
        && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == false) return false;
    if (other.getCreatedAt() == null ^ this.getCreatedAt() == null) return false;
    if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == false)
      return false;
    if (other.getStackId() == null ^ this.getStackId() == null) return false;
    if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == false)
      return false;
    if (other.getVolumeType() == null ^ this.getVolumeType() == null) return false;
    if (other.getVolumeType() != null
        && other.getVolumeType().equals(this.getVolumeType()) == false) return false;
    if (other.getIops() == null ^ this.getIops() == null) return false;
    if (other.getIops() != null && other.getIops().equals(this.getIops()) == false) return false;
    return true;
  }
  public RaidArray unmarshall(JsonUnmarshallerContext context) throws Exception {
    RaidArray raidArray = new RaidArray();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("RaidArrayId", targetDepth)) {
          context.nextToken();
          raidArray.setRaidArrayId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("InstanceId", targetDepth)) {
          context.nextToken();
          raidArray.setInstanceId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("Name", targetDepth)) {
          context.nextToken();
          raidArray.setName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("RaidLevel", targetDepth)) {
          context.nextToken();
          raidArray.setRaidLevel(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("NumberOfDisks", targetDepth)) {
          context.nextToken();
          raidArray.setNumberOfDisks(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("Size", targetDepth)) {
          context.nextToken();
          raidArray.setSize(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("Device", targetDepth)) {
          context.nextToken();
          raidArray.setDevice(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("MountPoint", targetDepth)) {
          context.nextToken();
          raidArray.setMountPoint(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("AvailabilityZone", targetDepth)) {
          context.nextToken();
          raidArray.setAvailabilityZone(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("CreatedAt", targetDepth)) {
          context.nextToken();
          raidArray.setCreatedAt(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("StackId", targetDepth)) {
          context.nextToken();
          raidArray.setStackId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("VolumeType", targetDepth)) {
          context.nextToken();
          raidArray.setVolumeType(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("Iops", targetDepth)) {
          context.nextToken();
          raidArray.setIops(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }

      token = context.nextToken();
    }

    return raidArray;
  }