/** * Validates the global Attribute Definition create request. This method also trims the request parameters. Currently only format level is supported * * @param request the global Attribute Definition create request * * @throws IllegalArgumentException throws exception if any other level other than format is specified */ private void validateGlobalAttributeDefinitionCreateRequest(GlobalAttributeDefinitionCreateRequest request) { Assert.notNull(request, "A global attribute definition create request must be specified."); globalAttributeDefinitionHelper.validateGlobalAttributeDefinitionKey(request.getGlobalAttributeDefinitionKey()); if (!GlobalAttributeDefinitionLevelEntity.GlobalAttributeDefinitionLevels.BUS_OBJCT_FRMT.name() .equalsIgnoreCase(request.getGlobalAttributeDefinitionKey().getGlobalAttributeDefinitionLevel())) { throw new IllegalArgumentException(String.format("Global attribute definition with level \"%s\" is not supported.", request.getGlobalAttributeDefinitionKey().getGlobalAttributeDefinitionLevel())); } if (request.getAttributeValueListKey() != null) { attributeValueListHelper.validateAttributeValueListKey(request.getAttributeValueListKey()); } }
/** * Validates the global Attribute Definition create request. This method also trims the request parameters. Currently only format level is supported * * @param request the global Attribute Definition create request * * @throws IllegalArgumentException throws exception if any other level other than format is specified */ private void validateGlobalAttributeDefinitionCreateRequest(GlobalAttributeDefinitionCreateRequest request) { Assert.notNull(request, "A global attribute definition create request must be specified."); globalAttributeDefinitionHelper.validateGlobalAttributeDefinitionKey(request.getGlobalAttributeDefinitionKey()); if (!GlobalAttributeDefinitionLevelEntity.GlobalAttributeDefinitionLevels.BUS_OBJCT_FRMT.name() .equalsIgnoreCase(request.getGlobalAttributeDefinitionKey().getGlobalAttributeDefinitionLevel())) { throw new IllegalArgumentException(String.format("Global attribute definition with level \"%s\" is not supported.", request.getGlobalAttributeDefinitionKey().getGlobalAttributeDefinitionLevel())); } if (request.getAttributeValueListKey() != null) { attributeValueListHelper.validateAttributeValueListKey(request.getAttributeValueListKey()); } }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { { GlobalAttributeDefinitionKey theGlobalAttributeDefinitionKey; theGlobalAttributeDefinitionKey = this.getGlobalAttributeDefinitionKey(); strategy.appendField(locator, this, "globalAttributeDefinitionKey", buffer, theGlobalAttributeDefinitionKey, (this.globalAttributeDefinitionKey!= null)); } { AttributeValueListKey theAttributeValueListKey; theAttributeValueListKey = this.getAttributeValueListKey(); strategy.appendField(locator, this, "attributeValueListKey", buffer, theAttributeValueListKey, (this.attributeValueListKey!= null)); } return buffer; }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { { GlobalAttributeDefinitionKey theGlobalAttributeDefinitionKey; theGlobalAttributeDefinitionKey = this.getGlobalAttributeDefinitionKey(); strategy.appendField(locator, this, "globalAttributeDefinitionKey", buffer, theGlobalAttributeDefinitionKey, (this.globalAttributeDefinitionKey!= null)); } { AttributeValueListKey theAttributeValueListKey; theAttributeValueListKey = this.getAttributeValueListKey(); strategy.appendField(locator, this, "attributeValueListKey", buffer, theAttributeValueListKey, (this.attributeValueListKey!= null)); } return buffer; }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { { GlobalAttributeDefinitionKey theGlobalAttributeDefinitionKey; theGlobalAttributeDefinitionKey = this.getGlobalAttributeDefinitionKey(); strategy.appendField(locator, this, "globalAttributeDefinitionKey", buffer, theGlobalAttributeDefinitionKey, (this.globalAttributeDefinitionKey!= null)); } { AttributeValueListKey theAttributeValueListKey; theAttributeValueListKey = this.getAttributeValueListKey(); strategy.appendField(locator, this, "attributeValueListKey", buffer, theAttributeValueListKey, (this.attributeValueListKey!= null)); } return buffer; }
@Override public GlobalAttributeDefinition createGlobalAttributeDefinition(GlobalAttributeDefinitionCreateRequest request) { // Validate and trim the request parameters. validateGlobalAttributeDefinitionCreateRequest(request); // Validate the global Attribute Definition entity does not already exist in the database. globalAttributeDefinitionDaoHelper.validateGlobalAttributeDefinitionNoExists(request.getGlobalAttributeDefinitionKey()); //Get the existing global Attribute Definition level entity GlobalAttributeDefinitionLevelEntity globalAttributeDefinitionLevelEntity = globalAttributeDefinitionLevelDao.getGlobalAttributeDefinitionLevel(request.getGlobalAttributeDefinitionKey().getGlobalAttributeDefinitionLevel()); AttributeValueListEntity attributeValueListEntity = null; //Get the attribute value list if the attribute value key exists if (request.getAttributeValueListKey() != null) { //Get the existing attribute list and ensure it exists attributeValueListEntity = attributeValueListDaoHelper.getAttributeValueListEntity(request.getAttributeValueListKey()); } // Create and persist a new global Attribute Definition entity from the request information. GlobalAttributeDefinitionEntity globalAttributeDefinitionEntity = createGlobalAttributeDefinitionEntity(request.getGlobalAttributeDefinitionKey(), globalAttributeDefinitionLevelEntity, attributeValueListEntity); // Create and return the global Attribute Definition object from the persisted entity. return createGlobalAttributeDefinitionFromEntity(globalAttributeDefinitionEntity); }
@Override public GlobalAttributeDefinition createGlobalAttributeDefinition(GlobalAttributeDefinitionCreateRequest request) { // Validate and trim the request parameters. validateGlobalAttributeDefinitionCreateRequest(request); // Validate the global Attribute Definition entity does not already exist in the database. globalAttributeDefinitionDaoHelper.validateGlobalAttributeDefinitionNoExists(request.getGlobalAttributeDefinitionKey()); //Get the existing global Attribute Definition level entity GlobalAttributeDefinitionLevelEntity globalAttributeDefinitionLevelEntity = globalAttributeDefinitionLevelDao.getGlobalAttributeDefinitionLevel(request.getGlobalAttributeDefinitionKey().getGlobalAttributeDefinitionLevel()); AttributeValueListEntity attributeValueListEntity = null; //Get the attribute value list if the attribute value key exists if (request.getAttributeValueListKey() != null) { //Get the existing attribute list and ensure it exists attributeValueListEntity = attributeValueListDaoHelper.getAttributeValueListEntity(request.getAttributeValueListKey()); } // Create and persist a new global Attribute Definition entity from the request information. GlobalAttributeDefinitionEntity globalAttributeDefinitionEntity = createGlobalAttributeDefinitionEntity(request.getGlobalAttributeDefinitionKey(), globalAttributeDefinitionLevelEntity, attributeValueListEntity); // Create and return the global Attribute Definition object from the persisted entity. return createGlobalAttributeDefinitionFromEntity(globalAttributeDefinitionEntity); }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) { if ((object == null)||(this.getClass()!= object.getClass())) { return false; } if (this == object) { return true; } final GlobalAttributeDefinitionCreateRequest that = ((GlobalAttributeDefinitionCreateRequest) object); { GlobalAttributeDefinitionKey lhsGlobalAttributeDefinitionKey; lhsGlobalAttributeDefinitionKey = this.getGlobalAttributeDefinitionKey(); GlobalAttributeDefinitionKey rhsGlobalAttributeDefinitionKey; rhsGlobalAttributeDefinitionKey = that.getGlobalAttributeDefinitionKey(); if (!strategy.equals(LocatorUtils.property(thisLocator, "globalAttributeDefinitionKey", lhsGlobalAttributeDefinitionKey), LocatorUtils.property(thatLocator, "globalAttributeDefinitionKey", rhsGlobalAttributeDefinitionKey), lhsGlobalAttributeDefinitionKey, rhsGlobalAttributeDefinitionKey, (this.globalAttributeDefinitionKey!= null), (that.globalAttributeDefinitionKey!= null))) { return false; } } { AttributeValueListKey lhsAttributeValueListKey; lhsAttributeValueListKey = this.getAttributeValueListKey(); AttributeValueListKey rhsAttributeValueListKey; rhsAttributeValueListKey = that.getAttributeValueListKey(); if (!strategy.equals(LocatorUtils.property(thisLocator, "attributeValueListKey", lhsAttributeValueListKey), LocatorUtils.property(thatLocator, "attributeValueListKey", rhsAttributeValueListKey), lhsAttributeValueListKey, rhsAttributeValueListKey, (this.attributeValueListKey!= null), (that.attributeValueListKey!= null))) { return false; } } return true; }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) { if ((object == null)||(this.getClass()!= object.getClass())) { return false; } if (this == object) { return true; } final GlobalAttributeDefinitionCreateRequest that = ((GlobalAttributeDefinitionCreateRequest) object); { GlobalAttributeDefinitionKey lhsGlobalAttributeDefinitionKey; lhsGlobalAttributeDefinitionKey = this.getGlobalAttributeDefinitionKey(); GlobalAttributeDefinitionKey rhsGlobalAttributeDefinitionKey; rhsGlobalAttributeDefinitionKey = that.getGlobalAttributeDefinitionKey(); if (!strategy.equals(LocatorUtils.property(thisLocator, "globalAttributeDefinitionKey", lhsGlobalAttributeDefinitionKey), LocatorUtils.property(thatLocator, "globalAttributeDefinitionKey", rhsGlobalAttributeDefinitionKey), lhsGlobalAttributeDefinitionKey, rhsGlobalAttributeDefinitionKey, (this.globalAttributeDefinitionKey!= null), (that.globalAttributeDefinitionKey!= null))) { return false; } } { AttributeValueListKey lhsAttributeValueListKey; lhsAttributeValueListKey = this.getAttributeValueListKey(); AttributeValueListKey rhsAttributeValueListKey; rhsAttributeValueListKey = that.getAttributeValueListKey(); if (!strategy.equals(LocatorUtils.property(thisLocator, "attributeValueListKey", lhsAttributeValueListKey), LocatorUtils.property(thatLocator, "attributeValueListKey", rhsAttributeValueListKey), lhsAttributeValueListKey, rhsAttributeValueListKey, (this.attributeValueListKey!= null), (that.attributeValueListKey!= null))) { return false; } } return true; }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) { if ((object == null)||(this.getClass()!= object.getClass())) { return false; } if (this == object) { return true; } final GlobalAttributeDefinitionCreateRequest that = ((GlobalAttributeDefinitionCreateRequest) object); { GlobalAttributeDefinitionKey lhsGlobalAttributeDefinitionKey; lhsGlobalAttributeDefinitionKey = this.getGlobalAttributeDefinitionKey(); GlobalAttributeDefinitionKey rhsGlobalAttributeDefinitionKey; rhsGlobalAttributeDefinitionKey = that.getGlobalAttributeDefinitionKey(); if (!strategy.equals(LocatorUtils.property(thisLocator, "globalAttributeDefinitionKey", lhsGlobalAttributeDefinitionKey), LocatorUtils.property(thatLocator, "globalAttributeDefinitionKey", rhsGlobalAttributeDefinitionKey), lhsGlobalAttributeDefinitionKey, rhsGlobalAttributeDefinitionKey, (this.globalAttributeDefinitionKey!= null), (that.globalAttributeDefinitionKey!= null))) { return false; } } { AttributeValueListKey lhsAttributeValueListKey; lhsAttributeValueListKey = this.getAttributeValueListKey(); AttributeValueListKey rhsAttributeValueListKey; rhsAttributeValueListKey = that.getAttributeValueListKey(); if (!strategy.equals(LocatorUtils.property(thisLocator, "attributeValueListKey", lhsAttributeValueListKey), LocatorUtils.property(thatLocator, "attributeValueListKey", rhsAttributeValueListKey), lhsAttributeValueListKey, rhsAttributeValueListKey, (this.attributeValueListKey!= null), (that.attributeValueListKey!= null))) { return false; } } return true; }
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) { int currentHashCode = 1; { GlobalAttributeDefinitionKey theGlobalAttributeDefinitionKey; theGlobalAttributeDefinitionKey = this.getGlobalAttributeDefinitionKey(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "globalAttributeDefinitionKey", theGlobalAttributeDefinitionKey), currentHashCode, theGlobalAttributeDefinitionKey, (this.globalAttributeDefinitionKey!= null)); } { AttributeValueListKey theAttributeValueListKey; theAttributeValueListKey = this.getAttributeValueListKey(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "attributeValueListKey", theAttributeValueListKey), currentHashCode, theAttributeValueListKey, (this.attributeValueListKey!= null)); } return currentHashCode; }
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) { int currentHashCode = 1; { GlobalAttributeDefinitionKey theGlobalAttributeDefinitionKey; theGlobalAttributeDefinitionKey = this.getGlobalAttributeDefinitionKey(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "globalAttributeDefinitionKey", theGlobalAttributeDefinitionKey), currentHashCode, theGlobalAttributeDefinitionKey, (this.globalAttributeDefinitionKey!= null)); } { AttributeValueListKey theAttributeValueListKey; theAttributeValueListKey = this.getAttributeValueListKey(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "attributeValueListKey", theAttributeValueListKey), currentHashCode, theAttributeValueListKey, (this.attributeValueListKey!= null)); } return currentHashCode; }
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) { int currentHashCode = 1; { GlobalAttributeDefinitionKey theGlobalAttributeDefinitionKey; theGlobalAttributeDefinitionKey = this.getGlobalAttributeDefinitionKey(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "globalAttributeDefinitionKey", theGlobalAttributeDefinitionKey), currentHashCode, theGlobalAttributeDefinitionKey, (this.globalAttributeDefinitionKey!= null)); } { AttributeValueListKey theAttributeValueListKey; theAttributeValueListKey = this.getAttributeValueListKey(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "attributeValueListKey", theAttributeValueListKey), currentHashCode, theAttributeValueListKey, (this.attributeValueListKey!= null)); } return currentHashCode; }
if (globalAttributeDefinitionKeyShouldBeCopiedAndSet == Boolean.TRUE) { GlobalAttributeDefinitionKey sourceGlobalAttributeDefinitionKey; sourceGlobalAttributeDefinitionKey = this.getGlobalAttributeDefinitionKey(); GlobalAttributeDefinitionKey copyGlobalAttributeDefinitionKey = ((GlobalAttributeDefinitionKey) strategy.copy(LocatorUtils.property(locator, "globalAttributeDefinitionKey", sourceGlobalAttributeDefinitionKey), sourceGlobalAttributeDefinitionKey, (this.globalAttributeDefinitionKey!= null))); copy.setGlobalAttributeDefinitionKey(copyGlobalAttributeDefinitionKey);
if (globalAttributeDefinitionKeyShouldBeCopiedAndSet == Boolean.TRUE) { GlobalAttributeDefinitionKey sourceGlobalAttributeDefinitionKey; sourceGlobalAttributeDefinitionKey = this.getGlobalAttributeDefinitionKey(); GlobalAttributeDefinitionKey copyGlobalAttributeDefinitionKey = ((GlobalAttributeDefinitionKey) strategy.copy(LocatorUtils.property(locator, "globalAttributeDefinitionKey", sourceGlobalAttributeDefinitionKey), sourceGlobalAttributeDefinitionKey, (this.globalAttributeDefinitionKey!= null))); copy.setGlobalAttributeDefinitionKey(copyGlobalAttributeDefinitionKey);
if (globalAttributeDefinitionKeyShouldBeCopiedAndSet == Boolean.TRUE) { GlobalAttributeDefinitionKey sourceGlobalAttributeDefinitionKey; sourceGlobalAttributeDefinitionKey = this.getGlobalAttributeDefinitionKey(); GlobalAttributeDefinitionKey copyGlobalAttributeDefinitionKey = ((GlobalAttributeDefinitionKey) strategy.copy(LocatorUtils.property(locator, "globalAttributeDefinitionKey", sourceGlobalAttributeDefinitionKey), sourceGlobalAttributeDefinitionKey, (this.globalAttributeDefinitionKey!= null))); copy.setGlobalAttributeDefinitionKey(copyGlobalAttributeDefinitionKey);