/** * Validates a given c_domain_type constraint * <p> * TODO: does not report a problem on values that have a higher precision than specified * * @param cdtobj * @param archetype * @param errors */ private void validateCDomainType(CDomainType cdtobj, Archetype archetype, List<ValidationError> errors) { if (cdtobj.hasAssumedValue()) { log.debug("validating assumed value: " + cdtobj.getAssumedValue()); if (!cdtobj.validValue(cdtobj.getAssumedValue())) { ValidationError error = new ValidationError(ErrorType.VOBAV, null, cdtobj.getAssumedValue(), cdtobj.getRmTypeName(), cdtobj.path()); errors.add(error); } } else { log.debug("No assumed value found for : " + cdtobj.getRmTypeName() + " at " + cdtobj.path()); } if (cdtobj instanceof CCodePhrase) { validateCCodePhrase((CCodePhrase) cdtobj, errors); } else if (cdtobj instanceof CDvQuantity) { log.debug("validating CDVQuantity object at " + cdtobj.path()); checkArchetypeUnitsValidity((CDvQuantity) cdtobj, errors); } }
/** * Returns the hashcode of this object * * @return hashcode */ @Override public int hashCode() { return new HashCodeBuilder(3, 19) .appendSuper(super.hashCode()) .append(list) .toHashCode(); }
/** * Returns true if fields are the same */ public boolean equals(Object o) { if (this == o) return true; if (!( o instanceof CDvQuantity )) return false; final CDvQuantity cq = (CDvQuantity) o; return new EqualsBuilder() .appendSuper(super.equals(o)) .append(list, cq.list) .append(property, cq.property) .isEquals(); }
/** * Constructs a DomainTypeConstraint without default value or assumed value * * @param path * @param rmTypeName * @param occurrences * @param nodeID * @param defaultValue * @param assumedValue */ protected CDomainType(boolean anyAllowed, String path, String rmTypeName, Interval<Integer> occurrences, String nodeID, T defaultValue, T assumedValue, CAttribute parent) { super(anyAllowed, path, rmTypeName, occurrences, nodeID, parent); if(assumedValue != null && !validValue(assumedValue)) { throw new IllegalArgumentException("invalid assumedValue"); } this.defaultValue = defaultValue; this.assumedValue = assumedValue; }
/** * Returns true if fields are the same */ public boolean equals(Object o) { if (this == o) return true; if (!( o instanceof CDvQuantity )) return false; final CDvQuantity cq = (CDvQuantity) o; return new EqualsBuilder() .appendSuper(super.equals(o)) .append(list, cq.list) .append(property, cq.property) .isEquals(); }
/** * Constructs a DomainTypeConstraint without default value or assumed value * * @param path * @param rmTypeName * @param occurrences * @param nodeID * @param defaultValue * @param assumedValue */ protected CDomainType(boolean anyAllowed, String path, String rmTypeName, Interval<Integer> occurrences, String nodeID, T defaultValue, T assumedValue, CAttribute parent) { super(anyAllowed, path, rmTypeName, occurrences, nodeID, parent); if(assumedValue != null && !validValue(assumedValue)) { throw new IllegalArgumentException("invalid assumedValue"); } this.defaultValue = defaultValue; this.assumedValue = assumedValue; }
/** * Returns the hashcode of this object * * @return hashcode */ public int hashCode() { return new HashCodeBuilder(11, 37) .appendSuper(super.hashCode()) .append(list) .append(property) .toHashCode(); }
/** * Returns true if fields are the same */ @Override public boolean equals(Object o) { if (this == o) { return true; } if (!( o instanceof CDvOrdinal )) { return false; } final CDvOrdinal ordinal = (CDvOrdinal) o; return new EqualsBuilder() .appendSuper(super.equals(o)) .append(list, ordinal.list) .isEquals(); }
/** * Return a hash code of this object * * @return hash code */ @Override public int hashCode() { return new HashCodeBuilder(17, 31) .appendSuper(super.hashCode()) .append(value) .toHashCode(); }
/** * Two CCodePhrase equal if have same values * * @param o * @return true if equals */ public boolean equals(Object o) { if (this == o) return true; if (!( o instanceof CCodePhrase )) return false; final CCodePhrase ccp = (CCodePhrase) o; return new EqualsBuilder() .appendSuper(super.equals(o)) .append(terminologyId, ccp.terminologyId) .append(codeList, ccp.codeList) .isEquals(); }
/** * Returns the hashcode of this object * * @return hashcode */ public int hashCode() { return new HashCodeBuilder(11, 37) .appendSuper(super.hashCode()) .append(list) .append(property) .toHashCode(); }
/** * Returns true if fields are the same */ @Override public boolean equals(Object o) { if (this == o) { return true; } if (!( o instanceof CDvOrdinal )) { return false; } final CDvOrdinal ordinal = (CDvOrdinal) o; return new EqualsBuilder() .appendSuper(super.equals(o)) .append(list, ordinal.list) .isEquals(); }
/** * Return a hash code of this object * * @return hash code */ public int hashCode() { return new HashCodeBuilder(7, 37) .appendSuper(super.hashCode()) .append(terminologyId) .append(codeList) .toHashCode(); }
/** * Two CCodePhrase equal if have same values * * @param o * @return true if equals */ public boolean equals(Object o) { if (this == o) return true; if (!( o instanceof CCodePhrase )) return false; final CCodePhrase ccp = (CCodePhrase) o; return new EqualsBuilder() .appendSuper(super.equals(o)) .append(terminologyId, ccp.terminologyId) .append(codeList, ccp.codeList) .isEquals(); }
/** * Return a hash code of this object * * @return hash code */ public int hashCode() { return new HashCodeBuilder(7, 37) .appendSuper(super.hashCode()) .append(terminologyId) .append(codeList) .toHashCode(); }
/** * Equals if two CObject has same values * * @param o * @return true if equals */ @Override public boolean equals(Object o) { if (this == o) { return true; } if (!( o instanceof CDvState )) { return false; } final CDvState cobj = (CDvState) o; return new EqualsBuilder() .appendSuper(super.equals(o)) .append(value, cobj.value) .isEquals(); }
/** * Return a hash code of this object * * @return hash code */ @Override public int hashCode() { return new HashCodeBuilder(17, 31) .appendSuper(super.hashCode()) .append(value) .toHashCode(); }
/** * Equals if two CObject has same values * * @param o * @return true if equals */ @Override public boolean equals(Object o) { if (this == o) { return true; } if (!( o instanceof CDvState )) { return false; } final CDvState cobj = (CDvState) o; return new EqualsBuilder() .appendSuper(super.equals(o)) .append(value, cobj.value) .isEquals(); }
/** * Returns the hashcode of this object * * @return hashcode */ @Override public int hashCode() { return new HashCodeBuilder(3, 19) .appendSuper(super.hashCode()) .append(list) .toHashCode(); }