Example #1
0
  /**
   * Set the child and parent into the collection of valid relationships stored in this entity.
   *
   * @param role attribute maps to the 'ftRels' attribute on 'ftHier' object class.
   * @param parent attribute maps to the 'ftRels' attribute on 'ftHier' object class.
   */
  public void setRelationship(String role, String parent) {
    if (relationships == null) {
      relationships = new ArrayList<Relationship>();
    }

    relationships.add(new Relationship(Strings.toUpperCase(role), Strings.toUpperCase(parent)));
  }
Example #2
0
  /**
   * Return true if child and parent represent a valid relationship that is contained within the
   * collection of relationships.
   *
   * @param role attribute maps to the 'ftRels' attribute on 'ftHier' object class.
   * @param parent attribute maps to the 'ftRels' attribute on 'ftHier' object class.
   */
  public boolean isRelationship(String role, String parent) {
    boolean result = false;

    if (relationships != null) {
      result =
          relationships.contains(
              new Relationship(Strings.toUpperCase(role), Strings.toUpperCase(parent)));
    }

    return result;
  }
Example #3
0
 /**
  * Remove the specified relationship from the collection of valid relationships stored in this
  * entity.
  *
  * @param role attribute maps to the 'ftRels' attribute on 'ftHier' object class.
  * @param parent attribute maps to the 'ftRels' attribute on 'ftHier' object class.
  */
 public void removeRelationship(String role, String parent) {
   if (relationships != null) {
     relationships.remove(
         new Relationship(Strings.toUpperCase(role), Strings.toUpperCase(parent)));
   }
 }