Ejemplo n.º 1
0
  /**
   * Determines if this Service is equal to another Service
   *
   * <p>Compares: 1) the URI to the XQuery containing the Resource Function 2) the name of the
   * Resource Function 3) the arity of the Resource Function
   */
  @Override
  public boolean equals(final Object obj) {
    final FunctionSignature fnSignature = getResourceFunction().getFunctionSignature();

    if (obj == null) {
      return false;
    }

    if (!(obj instanceof RestXqService)) {
      return false;
    }

    final RestXqService other = ((RestXqService) obj);

    return other
            .getResourceFunction()
            .getXQueryLocation()
            .equals(getResourceFunction().getXQueryLocation())
        && other
            .getResourceFunction()
            .getFunctionSignature()
            .getName()
            .equals(fnSignature.getName())
        && other.getResourceFunction().getFunctionSignature().getArgumentCount()
            == fnSignature.getArgumentCount();
  }
Ejemplo n.º 2
0
 /**
  * Generates a Hash Code for the RestXqService Object
  *
  * <p>XORs together: 1) the URI to the XQuery containing the Resource Function 2) the name of the
  * Resource Function 3) the arity of the Resource Function
  */
 @Override
 public int hashCode() {
   final FunctionSignature fnSignature = getResourceFunction().getFunctionSignature();
   return getResourceFunction().getXQueryLocation().hashCode()
       ^ fnSignature.getName().hashCode()
       ^ fnSignature.getArgumentCount() * 32;
 }