@Override public Password toMemberType(final String datastoreValue) { return datastoreValue != null ? new Password(datastoreValue) : null; }
@Override public String toDatastoreType(final Password memberValue) { return memberValue != null ? memberValue.getPassword() : null; }
@Override public boolean equals(final Object other) { if (other == this) { return true; } if (other == null) { return false; } return other.getClass() == this.getClass() && equals((Password) other); }
@Test public void testCheckPassword() { final Password password = new Password("secret"); assertFalse(password.checkPassword("")); assertFalse(password.checkPassword("SECRET")); assertTrue(password.checkPassword("secret")); }
@Override public String titleString(final Object object, final Localization localization) { return object == null ? "" : password(object).toString(); }
@Override public boolean checkPassword(final ObjectAdapter object, final String password) { return password(object.getObject()).checkPassword(password); }
@Override protected Password doRestore(final String data) { return new Password(data); }
public boolean equals(final Password other) { final String otherPassword = other.getPassword(); if (getPassword() == null && otherPassword == null) { return true; } if (getPassword() == null || otherPassword == null) { return false; } return getPassword().equals(otherPassword); }
@Override public boolean equals(final Object other) { if (other == this) { return true; } if (other == null) { return false; } return other.getClass() == this.getClass() && equals((Password) other); }
@Override protected Password doParse(final Object context, final String text) { return new Password(text); }
public boolean equals(final Password other) { final String otherPassword = other.getPassword(); if (getPassword() == null && otherPassword == null) { return true; } if (getPassword() == null || otherPassword == null) { return false; } return getPassword().equals(otherPassword); }
@Override public ObjectAdapter createValue(final String password) { return getAdapterMap().adapterFor(new Password(password)); }
@Override public String getEditText(final ObjectAdapter object) { return object == null ? "" : password(object).getPassword(); }
@Programmatic public Password any() { return new Password(fake.strings().fixed(12)); } }
@Override protected String doEncode(final Object object) { return password(object).getPassword(); }
@Before public void setUpObjects() throws Exception { holder = new FacetHolderImpl(); setValue(adapter = new PasswordValueSemanticsProvider(holder, mockServicesInjector)); password = new Password("secret"); }
@Override protected Object preparedStatementObject(final ObjectAdapter value) { if (value == null) { return null; } final Object o = value.getObject(); if (o instanceof Money) { return ((Money) o).floatValue(); } else if (o instanceof Percentage) { return ((Percentage) o).floatValue(); } else if (o instanceof Password) { return ((Password) o).getPassword(); } else if (o instanceof String) { return o; } else if (o instanceof Boolean) { return o; } else { if (columnType().contains("CHAR")) { final EncodableFacet facet = value.getSpecification().getFacet(EncodableFacet.class); final String encodedString = facet.toEncodedString(value); return encodedString; } else { return o; } } }
@Before public void setUpObjects() throws Exception { holder = new FacetHolderImpl(); setValue(adapter = new PasswordValueSemanticsProvider(holder, mockConfiguration, mockContext)); password = new Password("secret"); }
applicationUser = wrap(applicationUserMenu).newDelegateUser(username, initialRole, enabled); } else { final Password passwordValue = new Password(password); applicationUser = wrap(applicationUserMenu).newLocalUser(username, passwordValue, passwordValue, initialRole, enabled, emailAddress);