コード例 #1
0
 public RailSelfPropulsionPGImpl(RailSelfPropulsionPG original) {
   theFuelConsumptionPerMile = original.getFuelConsumptionPerMile();
   theEngineType = original.getEngineType();
   theFuelType = original.getFuelType();
   theMaximumSpeed = original.getMaximumSpeed();
   theCruiseSpeed = original.getCruiseSpeed();
   theFullPayloadRange = original.getFullPayloadRange();
   theEmptyPayloadRange = original.getEmptyPayloadRange();
 }
コード例 #2
0
  public boolean equals(Object other) {

    if (!(other instanceof RailSelfPropulsionPG)) {
      return false;
    }

    RailSelfPropulsionPG otherRailSelfPropulsionPG = (RailSelfPropulsionPG) other;

    if (getFuelConsumptionPerMile() == null) {
      if (otherRailSelfPropulsionPG.getFuelConsumptionPerMile() != null) {
        return false;
      }
    } else if (!(getFuelConsumptionPerMile()
        .equals(otherRailSelfPropulsionPG.getFuelConsumptionPerMile()))) {
      return false;
    }

    if (getEngineType() == null) {
      if (otherRailSelfPropulsionPG.getEngineType() != null) {
        return false;
      }
    } else if (!(getEngineType().equals(otherRailSelfPropulsionPG.getEngineType()))) {
      return false;
    }

    if (getFuelType() == null) {
      if (otherRailSelfPropulsionPG.getFuelType() != null) {
        return false;
      }
    } else if (!(getFuelType().equals(otherRailSelfPropulsionPG.getFuelType()))) {
      return false;
    }

    if (getMaximumSpeed() == null) {
      if (otherRailSelfPropulsionPG.getMaximumSpeed() != null) {
        return false;
      }
    } else if (!(getMaximumSpeed().equals(otherRailSelfPropulsionPG.getMaximumSpeed()))) {
      return false;
    }

    if (getCruiseSpeed() == null) {
      if (otherRailSelfPropulsionPG.getCruiseSpeed() != null) {
        return false;
      }
    } else if (!(getCruiseSpeed().equals(otherRailSelfPropulsionPG.getCruiseSpeed()))) {
      return false;
    }

    if (getFullPayloadRange() == null) {
      if (otherRailSelfPropulsionPG.getFullPayloadRange() != null) {
        return false;
      }
    } else if (!(getFullPayloadRange().equals(otherRailSelfPropulsionPG.getFullPayloadRange()))) {
      return false;
    }

    if (getEmptyPayloadRange() == null) {
      if (otherRailSelfPropulsionPG.getEmptyPayloadRange() != null) {
        return false;
      }
    } else if (!(getEmptyPayloadRange().equals(otherRailSelfPropulsionPG.getEmptyPayloadRange()))) {
      return false;
    }

    return true;
  }