/** * Gets the value of this {@link EntityProperty} as a <code>String</code>. * * @return * A <code>String</code> representation of the {@link EntityProperty} value, or <code>null</code>. */ public String getValueAsString() { return this.getIsNull() ? null : this.value; }
/** * Gets the value of this {@link EntityProperty} as a <code>String</code>. * * @return * A <code>String</code> representation of the {@link EntityProperty} value, or <code>null</code>. */ public String getValueAsString() { return this.getIsNull() ? null : this.value; }
/** * Gets the value of this {@link EntityProperty} as a <code>java.util.UUID</code>. * * @return * A <code>java.util.UUID</code> representation of the {@link EntityProperty} value, or <code>null</code>. * * @throws IllegalArgumentException * If the value cannot be parsed as a <code>java.util.UUID</code>. */ public UUID getValueAsUUID() { return this.getIsNull() ? null : UUID.fromString(this.value); }
/** * Gets the value of this {@link EntityProperty} as an <code>Integer</code>. * * @return * An <code>Integer</code> representation of the {@link EntityProperty} value. * * @throws IllegalArgumentException * If the value is <code>null</code> or cannot be parsed as an <code>int</code>. */ public Integer getValueAsIntegerObject() { return this.getIsNull() ? null : Integer.parseInt(this.value); }
/** * Gets the value of this {@link EntityProperty} as a <code>java.util.UUID</code>. * * @return * A <code>java.util.UUID</code> representation of the {@link EntityProperty} value, or <code>null</code>. * * @throws IllegalArgumentException * If the value cannot be parsed as a <code>java.util.UUID</code>. */ public UUID getValueAsUUID() { return this.getIsNull() ? null : UUID.fromString(this.value); }
/** * Gets the value of this {@link EntityProperty} as a <code>Long</code>. * * @return * A <code>long</code> representation of the {@link EntityProperty} value. * * @throws IllegalArgumentException * If the value is <code>null</code> or cannot be parsed as a <code>long</code>. */ public Long getValueAsLongObject() { return this.getIsNull() ? null : Long.parseLong(this.value); }
/** * Gets the value of this {@link EntityProperty} as an <code>Integer</code>. * * @return * An <code>Integer</code> representation of the {@link EntityProperty} value. * * @throws IllegalArgumentException * If the value is <code>null</code> or cannot be parsed as an <code>int</code>. */ public Integer getValueAsIntegerObject() { return this.getIsNull() ? null : Integer.parseInt(this.value); }
/** * Gets the value of this {@link EntityProperty} as a <code>Long</code>. * * @return * A <code>long</code> representation of the {@link EntityProperty} value. * * @throws IllegalArgumentException * If the value is <code>null</code> or cannot be parsed as a <code>long</code>. */ public Long getValueAsLongObject() { return this.getIsNull() ? null : Long.parseLong(this.value); }
/** * Gets the value of this {@link EntityProperty} as a <code>Boolean</code>. * * @return * A <code>Boolean</code> representation of the {@link EntityProperty} value. * * @throws IllegalArgumentException * If the value is <code>null</code> or cannot be parsed as a <code>Boolean</code>. */ public Boolean getValueAsBooleanObject() { if (this.getIsNull()) { return null; } return Boolean.parseBoolean(this.value); }
/** * Gets the value of this {@link EntityProperty} as a <code>long</code>. * * @return * A <code>long</code> representation of the {@link EntityProperty} value. * * @throws IllegalArgumentException * If the value is <code>null</code> or cannot be parsed as a <code>long</code>. */ public long getValueAsLong() { if (this.getIsNull()) { throw new IllegalArgumentException(SR.ENTITY_PROPERTY_CANNOT_BE_NULL_FOR_PRIMITIVES); } return Long.parseLong(this.value); }
/** * Gets the value of this {@link EntityProperty} as an <code>int</code>. * * @return * An <code>int</code> representation of the {@link EntityProperty} value. * * @throws IllegalArgumentException * If the value is <code>null</code> or cannot be parsed as an <code>int</code>. */ public int getValueAsInteger() { if (this.getIsNull()) { throw new IllegalArgumentException(SR.ENTITY_PROPERTY_CANNOT_BE_NULL_FOR_PRIMITIVES); } return Integer.parseInt(this.value); }
/** * Gets the value of this {@link EntityProperty} as a <code>boolean</code>. * * @return * A <code>boolean</code> representation of the {@link EntityProperty} value. * * @throws IllegalArgumentException * If the value is <code>null</code> or cannot be parsed as a <code>Boolean</code>. */ public boolean getValueAsBoolean() { if (this.getIsNull()) { throw new IllegalArgumentException(SR.ENTITY_PROPERTY_CANNOT_BE_NULL_FOR_PRIMITIVES); } return Boolean.parseBoolean(this.value); }
/** * Gets the value of this {@link EntityProperty} as a <code>boolean</code>. * * @return * A <code>boolean</code> representation of the {@link EntityProperty} value. * * @throws IllegalArgumentException * If the value is <code>null</code> or cannot be parsed as a <code>Boolean</code>. */ public boolean getValueAsBoolean() { if (this.getIsNull()) { throw new IllegalArgumentException(SR.ENTITY_PROPERTY_CANNOT_BE_NULL_FOR_PRIMITIVES); } return Boolean.parseBoolean(this.value); }
/** * Gets the value of this {@link EntityProperty} as a <code>byte</code> array. * * @return * A <code>byte[]</code> representation of the {@link EntityProperty} value, or <code>null</code>. */ public byte[] getValueAsByteArray() { return this.getIsNull() ? null : Base64.decode(this.value); }
/** * Gets the value of this {@link EntityProperty} as a <code>Byte</code> array. * * @return * A <code>Byte[]</code> representation of the {@link EntityProperty} value, or <code>null</code>. */ public Byte[] getValueAsByteObjectArray() { return this.getIsNull() ? null : Base64.decodeAsByteObjectArray(this.value); }
private static HashSet<String> parsePropertyDetails(EntityProperty propertyDetailsProperty) throws UnsupportedEncodingException { HashSet<String> encryptedPropertyDetailsSet = null; if (propertyDetailsProperty != null && !propertyDetailsProperty.getIsNull()) { byte[] binaryVal = propertyDetailsProperty.getValueAsByteArray(); // The below code will work for both potential property details formats (JavaV1 and .NET). String stringProperty = new String(binaryVal, 0, binaryVal.length, Constants.UTF8_CHARSET).replaceAll(" ", "").replaceAll("\"", ""); encryptedPropertyDetailsSet = new HashSet<String>( Arrays.asList(stringProperty.substring(1, stringProperty.length() - 1).split(","))); } return encryptedPropertyDetailsSet; } }
/** * Gets the value of this {@link EntityProperty} as a <code>java.util.Date</code>. * * @return * A <code>java.util.Date</code> representation of the {@link EntityProperty} value, or <code>null</code>. * * @throws IllegalArgumentException * If the value is not <code>null</code> and cannot be parsed as a <code>java.util.Date</code>. */ public Date getValueAsDate() { return this.getIsNull() ? null : Utility.parseDate(this.value, this.dateBackwardCompatibility); }
/** * Gets the value of this {@link EntityProperty} as a <code>byte</code> array. * * @return * A <code>byte[]</code> representation of the {@link EntityProperty} value, or <code>null</code>. */ public byte[] getValueAsByteArray() { return this.getIsNull() ? null : Base64.decode(this.value); }
/** * Gets the value of this {@link EntityProperty} as a <code>Byte</code> array. * * @return * A <code>Byte[]</code> representation of the {@link EntityProperty} value, or <code>null</code>. */ public Byte[] getValueAsByteObjectArray() { return this.getIsNull() ? null : Base64.decodeAsByteObjectArray(this.value); }
/** * Gets the value of this {@link EntityProperty} as a <code>java.util.Date</code>. * * @return * A <code>java.util.Date</code> representation of the {@link EntityProperty} value, or <code>null</code>. * * @throws IllegalArgumentException * If the value is not <code>null</code> and cannot be parsed as a <code>java.util.Date</code>. */ public Date getValueAsDate() { return this.getIsNull() ? null : Utility.parseDate(this.value, this.dateBackwardCompatibility); }