/** * Construct a new wrapped signed property from the given values. * @param name - the name of the property. * @param value - the value of the property. * @param signature - the BASE64-encoded signature of the value. * @return The signed property. */ public static WrappedSignedProperty fromValues(String name, String value, String signature) { return new WrappedSignedProperty(name, value, signature); }
@Override protected WrappedSignedProperty toOuter(Object inner) { return WrappedSignedProperty.fromHandle(inner); } };
@Override public String toString() { return "WrappedSignedProperty[name=" + getName() + ", value=" + getValue() + ", signature=" + getSignature() + "]"; } }
/** * Construct a new wrapped signed property from a given handle. * @param handle - the handle. */ private WrappedSignedProperty(Object handle) { super(PROPERTY); setHandle(handle); }
private WrappedSignedProperty convertToProperty(SkinModel skinData) { String encodedValue = skinData.getEncodedValue(); String signature = skinData.getSignature(); return WrappedSignedProperty.fromValues(SkinProperty.SKIN_KEY, encodedValue, signature); } }
@Override public int hashCode() { return Objects.hashCode(getName(), getValue(), getSignature()); }
/** * Construct a new signed property from a given NMS property. * @param handle - the property. * @return The wrapped signed property. */ public static WrappedSignedProperty fromHandle(Object handle) { return new WrappedSignedProperty(handle); }
@Override public boolean equals(Object object) { if (object == this) return true; if (object instanceof WrappedSignedProperty) { WrappedSignedProperty that = (WrappedSignedProperty) object; return Objects.equal(this.getName(), that.getName()) && Objects.equal(this.getValue(), that.getValue()) && Objects.equal(this.getSignature(), that.getSignature()); } return false; }