ScriptCapabilityType capScript = new ScriptCapabilityType(); if (supportedOperations.contains(ScriptOnResourceApiOp.class)) { Host host = new Host(); host.setType(ProvisioningScriptHostType.RESOURCE); capScript.getHost().add(host); Host host = new Host(); host.setType(ProvisioningScriptHostType.CONNECTOR); capScript.getHost().add(host);
/** * Creates and returns a deep copy of this object. * * * @return * A deep copy of this object. */ @Override public ScriptCapabilityType.Host clone() { try { { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 final ScriptCapabilityType.Host clone = ((ScriptCapabilityType.Host) super.clone()); // CEnumLeafInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ProvisioningScriptHostType clone.type = ((this.type == null)?null:this.getType()); // 'Language' collection. if (this.language!= null) { clone.language = null; copyLanguage(this.getLanguage(), clone.getLanguage()); } return clone; } } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); } }
/** * Copies all values of property {@code Host} deeply. * * @param source * The source to copy from. * @param target * The target to copy {@code source} to. * @throws NullPointerException * if {@code target} is {@code null}. */ @SuppressWarnings("unchecked") private static void copyHost(final List<ScriptCapabilityType.Host> source, final List<ScriptCapabilityType.Host> target) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 if ((source!= null)&&(!source.isEmpty())) { for (final Iterator<?> it = source.iterator(); it.hasNext(); ) { final Object next = it.next(); if (next instanceof ScriptCapabilityType.Host) { // CClassInfo: com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType$Host target.add(((ScriptCapabilityType.Host) next).clone()); continue; } // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Host' of class 'com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType'.")); } } }
assertEquals("Wrong number of script hosts", 1, scriptHosts.size()); Host scriptHost = scriptHosts.get(0); assertEquals("Wrong script host type", ProvisioningScriptHostType.CONNECTOR, scriptHost.getType());
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof ScriptCapabilityType.Host)) { return false; } if (this == object) { return true; } final ScriptCapabilityType.Host that = ((ScriptCapabilityType.Host) object); { ProvisioningScriptHostType lhsType; lhsType = this.getType(); ProvisioningScriptHostType rhsType; rhsType = that.getType(); if (!strategy.equals(LocatorUtils.property(thisLocator, "type", lhsType), LocatorUtils.property(thatLocator, "type", rhsType), lhsType, rhsType)) { return false; } } { List<String> lhsLanguage; lhsLanguage = (((this.language!= null)&&(!this.language.isEmpty()))?this.getLanguage():null); List<String> rhsLanguage; rhsLanguage = (((that.language!= null)&&(!that.language.isEmpty()))?that.getLanguage():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "language", lhsLanguage), LocatorUtils.property(thatLocator, "language", rhsLanguage), lhsLanguage, rhsLanguage)) { return false; } } return true; }
/** * Creates a new {@code Host} instance by deeply copying a given {@code Host} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public Host(final ScriptCapabilityType.Host o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 super(); if (o == null) { throw new NullPointerException("Cannot create a copy of 'Host' from 'null'."); } // CEnumLeafInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ProvisioningScriptHostType this.type = ((o.type == null)?null:o.getType()); // 'Language' collection. if (o.language!= null) { copyLanguage(o.getLanguage(), this.getLanguage()); } }
public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { ProvisioningScriptHostType theType; theType = this.getType(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "type", theType), currentHashCode, theType); } { List<String> theLanguage; theLanguage = (((this.language!= null)&&(!this.language.isEmpty()))?this.getLanguage():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "language", theLanguage), currentHashCode, theLanguage); } return currentHashCode; }
public ScriptCapabilityType.Host beginHost() { ScriptCapabilityType.Host value = new ScriptCapabilityType.Host(); host(value); return value; }
/** * Create an instance of {@link ScriptCapabilityType.Host } * */ public ScriptCapabilityType.Host createScriptCapabilityTypeHost() { return new ScriptCapabilityType.Host(); }
public ScriptCapabilityType.Host type(ProvisioningScriptHostType value) { setType(value); return this; }
public ScriptCapabilityType.Host language(String value) { getLanguage().add(value); return this; }
private void assertScriptHost(ScriptCapabilityType capScript, ProvisioningScriptHostType expectedHostType) { for (Host host: capScript.getHost()) { if (host.getType() == expectedHostType) { return; } } AssertJUnit.fail("No script capability with host type "+expectedHostType); }
/** * Create an instance of {@link ScriptCapabilityType.Host } * */ public ScriptCapabilityType.Host createScriptCapabilityTypeHost() { return new ScriptCapabilityType.Host(); }
/** * Create an instance of {@link ScriptCapabilityType.Host } * */ public ScriptCapabilityType.Host createScriptCapabilityTypeHost() { return new ScriptCapabilityType.Host(); }