Exemplo n.º 1
0
 public boolean check(AssociationDescriptor descriptor, ServiceElement element) {
   return (ServiceElementUtil.matchesServiceElement(
       element,
       descriptor.getName(),
       descriptor.getInterfaceNames(),
       descriptor.getOperationalStringName()));
 }
Exemplo n.º 2
0
  /**
   * An AssociationDescriptor is equal to another AssociationDescriptor if their name, opStringName
   * and {@link AssociationType} attributes are equal
   */
  public boolean equals(final Object obj) {
    if (this == obj) return true;
    if (!(obj instanceof AssociationDescriptor)) return false;
    AssociationDescriptor that = (AssociationDescriptor) obj;
    if (this.type.equals(that.type) && this.getName().equals(that.getName())) {
      boolean matched = false;
      /* Check propertyName attributes */
      if (this.opStringName != null
          && that.opStringName != null
          && this.opStringName.equals(that.opStringName)) {
        matched = true;
      }
      if (this.opStringName == null && that.opStringName == null) matched = true;

      if (!matched) return matched;

      if (!Arrays.equals(this.interfaceNames, that.interfaceNames)) return false;

      /* Check propertyName attributes */
      if (this.propertyName != null
          && that.propertyName != null
          && this.propertyName.equals(that.propertyName)) {
        return true;
      }
      if (this.propertyName == null && that.propertyName == null) return true;
    }
    return (false);
  }