public static <T> boolean contains(final T[] array, final T object) { for (final T item : array) { if (ObjectUtilities.equals(item, object)) { return true; } } return false; }
@Override public int hashCode() { return ObjectUtilities.hashCode(this.startValue, this.endValue); } }
@Override public String getText(final T value) { return ObjectUtilities.toString(value, this.nullValueString); }
public static String toString(final Object object, final String nullValue) { if (object == null) { return nullValue; } if (Object.class.equals(object.getClass())) { return Integer.toHexString(object.hashCode()); } if (ObjectUtilities.isToStringImplemented(object.getClass())) { return object.toString(); } if (System.getSecurityManager() == null) { final Field[] fields = object.getClass().getDeclaredFields(); return toString(object, fields, nullValue); } return AccessController.doPrivileged((PrivilegedAction<String>) () -> { final Field[] fields = object.getClass().getDeclaredFields(); return ObjectUtilities.toString(object, fields, nullValue); }); }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (!(obj instanceof ObjectInterval)) { return false; } final ObjectInterval<?> other = (ObjectInterval<?>) obj; return ObjectUtilities.equals(new Object[] { this.startValue, this.endValue }, new Object[] { other.startValue, other.endValue }); }
public DependencyRelationKey(final String identifier, final RelationType relationType) { this.identifier = identifier; this.relationType = relationType; hashCode = ObjectUtilities.hashCode(this.identifier, this.relationType); }
public static String toString(final Object object) { return toString(object, (String) null); }
public static <T> boolean contains(final T[] array, final T object) { for (final T item : array) { if (ObjectUtilities.equals(item, object)) { return true; } } return false; }
@Override public int hashCode() { return ObjectUtilities.hashCode(this.startValue, this.endValue); } }
@Override public String get(final String key, final String defaultValue) { if (this.preferencesByName.containsKey(key)) { final Object object = this.preferencesByName.get(key); return object == null ? defaultValue : ObjectUtilities.toString(object); } return defaultValue; }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (!(obj instanceof ObjectInterval)) { return false; } final ObjectInterval<?> other = (ObjectInterval<?>) obj; return ObjectUtilities.equals(new Object[] { this.startValue, this.endValue }, new Object[] { other.startValue, other.endValue }); }
@Override public int hashCode() { return ObjectUtilities.hashCode(Boolean.valueOf(this.isValid), this.message); }
@Override public boolean getBoolean(final String key, final boolean defaultValue) { if (this.preferencesByName.containsKey(key)) { final Object object = this.preferencesByName.get(key); return object == null ? defaultValue : Boolean.valueOf(ObjectUtilities.toString(object)).booleanValue(); } return defaultValue; }
public ObjectModel(final T value) { this(true, (t, o) -> ObjectUtilities.equals(t, o), value); }
@Override public int hashCode() { return ObjectUtilities.hashCode(Boolean.valueOf(this.isValid), this.message); }
@Override public int getInt(final String key, final int defaultValue) { if (this.preferencesByName.containsKey(key)) { final Object object = this.preferencesByName.get(key); if (object instanceof Number) { return ((Number) object).intValue(); } return object == null ? defaultValue : Integer.valueOf(ObjectUtilities.toString(object)).intValue(); } return defaultValue; }
public static boolean equals(final Object[] os, final Object[] bs) { if (os == bs || (os == null && bs == null)) { return true; } if (os == null || bs == null || os.length != bs.length) { return false; } for (int i = 0; i < bs.length; i++) { if (!equals(os[i], bs[i])) { return false; } } return true; }
public static int hashCode(final int result, final int prime, final double value) { return hashCode(result, prime, Double.doubleToLongBits(value)); }
@Override public double getDouble(final String key, final double defaultValue) { if (this.preferencesByName.containsKey(key)) { final Object object = this.preferencesByName.get(key); if (object instanceof Number) { return ((Number) object).doubleValue(); } return object == null ? defaultValue : Double.valueOf(ObjectUtilities.toString(object)).doubleValue(); } return defaultValue; }
public static boolean equals(final double org, final double other) { return equals(Double.valueOf(org), Double.valueOf(other)); }