Example #1
0
 @Override
 public int hashCode() {
   int result = super.hashCode();
   result = 31 * result + (latitudeRole != null ? latitudeRole.hashCode() : 0);
   result = 31 * result + (longitudeRole != null ? longitudeRole.hashCode() : 0);
   return result;
 }
Example #2
0
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    if (!super.equals(o)) {
      return false;
    }

    LocationRole that = (LocationRole) o;

    if (latitudeRole != null
        ? !latitudeRole.equals(that.latitudeRole)
        : that.latitudeRole != null) {
      return false;
    }

    if (longitudeRole != null
        ? !longitudeRole.equals(that.longitudeRole)
        : that.longitudeRole != null) {
      return false;
    }

    return true;
  }
Example #3
0
 public String getPrefix() {
   if (latitudeRole != null && longitudeRole != null) {
     String prefix = latitudeRole.getPrefix();
     if (prefix.equalsIgnoreCase(longitudeRole.getPrefix())) {
       return prefix;
     }
   }
   return "";
 }
Example #4
0
  @Override
  public boolean evaluate(String fieldName) {
    boolean result = false;

    if (latitudeRole != null) {
      result = latitudeRole.evaluate(fieldName);
      if (result) {
        return result;
      }
    }
    if (longitudeRole != null) {
      return result || longitudeRole.evaluate(fieldName);
    }

    return result;
  }
Example #5
0
 public boolean evaluateLongitude(String fieldName) {
   if (longitudeRole != null) {
     return longitudeRole.evaluate(fieldName);
   }
   return false;
 }