/** * Create an instance of {@link NodeTag } * */ public NodeTag createNodeTag() { return new NodeTag(); }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { { String theTagName; theTagName = this.getTagName(); strategy.appendField(locator, this, "tagName", buffer, theTagName, (this.tagName!= null)); } { String theTagValue; theTagValue = this.getTagValue(); strategy.appendField(locator, this, "tagValue", buffer, theTagValue, (this.tagValue!= null)); } return buffer; }
public String toString() { final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE; final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); }
public Object clone() { return copyTo(createNewInstance()); }
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof NodeTag) { final NodeTag copy = ((NodeTag) draftCopy); if (tagNameShouldBeCopiedAndSet == Boolean.TRUE) { String sourceTagName; sourceTagName = this.getTagName(); String copyTagName = ((String) strategy.copy(LocatorUtils.property(locator, "tagName", sourceTagName), sourceTagName, (this.tagName!= null))); copy.setTagName(copyTagName); } else { if (tagNameShouldBeCopiedAndSet == Boolean.FALSE) { if (tagValueShouldBeCopiedAndSet == Boolean.TRUE) { String sourceTagValue; sourceTagValue = this.getTagValue(); String copyTagValue = ((String) strategy.copy(LocatorUtils.property(locator, "tagValue", sourceTagValue), sourceTagValue, (this.tagValue!= null))); copy.setTagValue(copyTagValue); } else { if (tagValueShouldBeCopiedAndSet == Boolean.FALSE) {
/** * Builds a list of all specified node tags, except for the excluded one. * * @param nodeTagNames the list of the node tag names * @param excludedNodeTagName the name of the node tag that should be excluded from the list * * @return the list of the node tags */ private List<NodeTag> getTestNodeTags(List<String> nodeTagNames, String excludedNodeTagName) { // Build a list of the node tags that would have all specified node tags, except for the excluded one. List<NodeTag> nodeTags = new ArrayList<>(); for (String nodeTagName : nodeTagNames) { if (!nodeTagName.equals(excludedNodeTagName)) { NodeTag nodeTag = new NodeTag(); nodeTag.setTagName(nodeTagName); nodeTag.setTagValue(ATTRIBUTE_VALUE_1); nodeTags.add(nodeTag); } } return nodeTags; } }
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; }
public boolean equals(Object object) { final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); }
public Object copyTo(Object target) { final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE; return copyTo(null, target, strategy); }
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof NodeTag) { final NodeTag copy = ((NodeTag) draftCopy); if (tagNameShouldBeCopiedAndSet == Boolean.TRUE) { String sourceTagName; sourceTagName = this.getTagName(); String copyTagName = ((String) strategy.copy(LocatorUtils.property(locator, "tagName", sourceTagName), sourceTagName, (this.tagName!= null))); copy.setTagName(copyTagName); } else { if (tagNameShouldBeCopiedAndSet == Boolean.FALSE) { if (tagValueShouldBeCopiedAndSet == Boolean.TRUE) { String sourceTagValue; sourceTagValue = this.getTagValue(); String copyTagValue = ((String) strategy.copy(LocatorUtils.property(locator, "tagValue", sourceTagValue), sourceTagValue, (this.tagValue!= null))); copy.setTagValue(copyTagValue); } else { if (tagValueShouldBeCopiedAndSet == Boolean.FALSE) {
/** * This method tests the blank EC2 tags */ @Test public void testCreateEmrClusterBlankTags() throws Exception { // Create the namespace entity. namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE); String configXml = IOUtils.toString(resourceLoader.getResource(EMR_CLUSTER_DEFINITION_XML_FILE_WITH_CLASSPATH).getInputStream()); EmrClusterDefinition emrClusterDefinition = xmlHelper.unmarshallXmlToObject(EmrClusterDefinition.class, configXml); // Add new node tags. First tag does not contain any tag value; but contains node tag name NodeTag nodeTag1 = new NodeTag(); nodeTag1.setTagName("NO_TAG_VALUE"); // Second tag does not contain node tag name; but contains node tag value NodeTag nodeTag2 = new NodeTag(); nodeTag2.setTagValue("NO_TAG_NAME"); // Create the list and add the tags ArrayList<NodeTag> nodeTagList = new ArrayList<>(); nodeTagList.add(nodeTag1); nodeTagList.add(nodeTag2); // Set the tags emrClusterDefinition.setNodeTags(nodeTagList); emrDao.createEmrCluster(EMR_CLUSTER_DEFINITION_NAME, emrClusterDefinition, emrHelper.getAwsParamsDto()); }
public Object clone() { return copyTo(createNewInstance()); }
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; }
public boolean equals(Object object) { final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); }
public Object copyTo(Object target) { final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE; return copyTo(null, target, strategy); }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { { String theTagName; theTagName = this.getTagName(); strategy.appendField(locator, this, "tagName", buffer, theTagName, (this.tagName!= null)); } { String theTagValue; theTagValue = this.getTagValue(); strategy.appendField(locator, this, "tagValue", buffer, theTagValue, (this.tagValue!= null)); } return buffer; }
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof NodeTag) { final NodeTag copy = ((NodeTag) draftCopy); if (tagNameShouldBeCopiedAndSet == Boolean.TRUE) { String sourceTagName; sourceTagName = this.getTagName(); String copyTagName = ((String) strategy.copy(LocatorUtils.property(locator, "tagName", sourceTagName), sourceTagName, (this.tagName!= null))); copy.setTagName(copyTagName); } else { if (tagNameShouldBeCopiedAndSet == Boolean.FALSE) { if (tagValueShouldBeCopiedAndSet == Boolean.TRUE) { String sourceTagValue; sourceTagValue = this.getTagValue(); String copyTagValue = ((String) strategy.copy(LocatorUtils.property(locator, "tagValue", sourceTagValue), sourceTagValue, (this.tagValue!= null))); copy.setTagValue(copyTagValue); } else { if (tagValueShouldBeCopiedAndSet == Boolean.FALSE) {
@Test public void testCreateEmrClusterDefinitionDuplicateNodeTags() throws Exception { // Try to perform a create with duplicate node tag names. try { EmrClusterDefinition emrClusterDefinitionConfiguration = getTestEmrClusterDefinitionConfiguration(EMR_CLUSTER_DEFINITION_XML_FILE_WITH_CLASSPATH); for (int i = 0; i < 2; i++) { NodeTag nodeTag = new NodeTag(); nodeTag.setTagName(ATTRIBUTE_NAME_1_MIXED_CASE); nodeTag.setTagValue(ATTRIBUTE_VALUE_1); emrClusterDefinitionConfiguration.getNodeTags().add(nodeTag); } emrClusterDefinitionService .createEmrClusterDefinition(createEmrClusterDefinitionCreateRequest(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, emrClusterDefinitionConfiguration)); fail("Should throw an IllegalArgumentException when duplicate node tag names are specified."); } catch (IllegalArgumentException e) { assertEquals(String.format("Duplicate node tag \"%s\" is found.", ATTRIBUTE_NAME_1_MIXED_CASE), e.getMessage()); } }
/** * Create an instance of {@link NodeTag } * */ public NodeTag createNodeTag() { return new NodeTag(); }
public Object clone() { return copyTo(createNewInstance()); }