public static boolean isPasswordReturnedByDefault(CredentialsCapabilityType capability) { if (capability == null) { return false; } PasswordCapabilityType password = capability.getPassword(); if (password == null) { return false; } if (password.isReturnedByDefault() == null) { return true; } return password.isReturnedByDefault(); }
/** * Creates a new {@code PasswordCapabilityType} instance by deeply copying a given {@code PasswordCapabilityType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public PasswordCapabilityType(final PasswordCapabilityType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 super(o); if (o == null) { throw new NullPointerException("Cannot create a copy of 'PasswordCapabilityType' from 'null'."); } // CBuiltinLeafInfo: java.lang.Boolean this.returnedByDefault = ((o.returnedByDefault == null)?null:o.isReturnedByDefault()); // CBuiltinLeafInfo: java.lang.Boolean this.readable = ((o.readable == null)?null:o.isReadable()); }
/** * Creates and returns a deep copy of this object. * * * @return * A deep copy of this object. */ @Override public PasswordCapabilityType clone() { { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 final PasswordCapabilityType clone = ((PasswordCapabilityType) super.clone()); // CBuiltinLeafInfo: java.lang.Boolean clone.returnedByDefault = ((this.returnedByDefault == null)?null:this.isReturnedByDefault()); // CBuiltinLeafInfo: java.lang.Boolean clone.readable = ((this.readable == null)?null:this.isReadable()); return clone; } }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = super.hashCode(locator, strategy); { Boolean theReturnedByDefault; theReturnedByDefault = this.isReturnedByDefault(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "returnedByDefault", theReturnedByDefault), currentHashCode, theReturnedByDefault); } { Boolean theReadable; theReadable = this.isReadable(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "readable", theReadable), currentHashCode, theReadable); } return currentHashCode; }
lhsReturnedByDefault = this.isReturnedByDefault(); Boolean rhsReturnedByDefault; rhsReturnedByDefault = that.isReturnedByDefault(); if (!strategy.equals(LocatorUtils.property(thisLocator, "returnedByDefault", lhsReturnedByDefault), LocatorUtils.property(thatLocator, "returnedByDefault", rhsReturnedByDefault), lhsReturnedByDefault, rhsReturnedByDefault)) { return false;
@Test public void test001Connection() throws Exception { final String TEST_NAME = "test001Connection"; TestUtil.displayTestTitle(TEST_NAME); Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); // WHEN OperationResult testResult = provisioningService.testResource(RESOURCE_DERBY_OID, task); display("Test result",testResult); TestUtil.assertSuccess("Test resource failed (result)", testResult); ResourceType resource = repositoryService.getObject(ResourceType.class, RESOURCE_DERBY_OID, null, result).asObjectable(); display("Resource after test",resource); display("Resource after test (XML)", PrismTestUtil.serializeObjectToString(resource.asPrismObject(), PrismContext.LANG_XML)); List<Object> nativeCapabilities = resource.getCapabilities().getNative().getAny(); CredentialsCapabilityType credentialsCapabilityType = CapabilityUtil.getCapability(nativeCapabilities, CredentialsCapabilityType.class); assertNotNull("No credentials capability", credentialsCapabilityType); PasswordCapabilityType passwordCapabilityType = credentialsCapabilityType.getPassword(); assertNotNull("No password in credentials capability", passwordCapabilityType); assertEquals("Wrong password capability ReturnedByDefault", Boolean.FALSE, passwordCapabilityType.isReturnedByDefault()); }
PasswordCapabilityType pc = cred.getPassword(); pc.setEnabled(def(pc.isEnabled(), true)); pc.setReturnedByDefault(def(pc.isReturnedByDefault(), true));