private static Pair<ClassTable, Writer> pair(final ClassTable classTable, final Writer writer) { return Pair.create(classTable, writer); }
/** * Create a new instance. * * @param a the first value * @param b the second value * @param <A> the first value type * @param <B> the second value type * @return the new instance */ public static <A, B> Pair<A, B> create(A a, B b) { return new Pair<A, B>(a, b); }
/** * Create a new instance. * * @param a the first value * @param b the second value */ public Pair(final A a, final B b) { this.a = a; this.b = b; hashCode = hashCode(a, b); }
/** * Determine if this pair equals another. A pair is equal to another pair if both members are equal. * * @param other the other pair * @return {@code true} if they are equal, {@code false} otherwise */ public boolean equals(final Object other) { return (other instanceof Pair) ? equals((Pair) other) : false; }
/** * Reinitialize the object and set the hash code. * * @param ois the object input stream * @throws IOException if an I/O error occurs while reading the default fields * @throws ClassNotFoundException if a class isn't found while reading the default fields */ private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { ois.defaultReadObject(); setter.setInt(this, hashCode(a, b)); }
/** * Determine if this pair equals another. A pair is equal to another pair if both members are equal. * * @param other the other pair * @return {@code true} if they are equal, {@code false} otherwise */ public boolean equals(final Object other) { return (other instanceof Pair) ? equals((Pair) other) : false; }
private static Pair<ObjectTable, Writer> pair(final ObjectTable objectTable, final Writer writer) { return Pair.create(objectTable, writer); }
/** * Create a new instance. * * @param a the first value * @param b the second value */ public Pair(final A a, final B b) { this.a = a; this.b = b; hashCode = hashCode(a, b); }
/** * Determine if this pair equals another. A pair is equal to another pair if both members are equal. * * @param other the other pair * @return {@code true} if they are equal, {@code false} otherwise */ public boolean equals(final Object other) { return (other instanceof Pair) ? equals((Pair) other) : false; }
/** * Create a new instance. * * @param a the first value * @param b the second value * @param <A> the first value type * @param <B> the second value type * @return the new instance */ public static <A, B> Pair<A, B> create(A a, B b) { return new Pair<A, B>(a, b); }
/** {@inheritDoc} */ public Object createExternal(final Class<?> subjectType, final ObjectInput input) throws IOException, ClassNotFoundException { return create(input.readObject(), input.readObject()); }
/** * Create a new instance. * * @param a the first value * @param b the second value */ public Pair(final A a, final B b) { this.a = a; this.b = b; hashCode = hashCode(a, b); }
/** * Determine if this pair equals another. A pair is equal to another pair if both members are equal. * * @param other the other pair * @return {@code true} if they are equal, {@code false} otherwise */ public boolean equals(final Object other) { return (other instanceof Pair) ? equals((Pair) other) : false; }
/** * Create a new instance. * * @param a the first value * @param b the second value * @param <A> the first value type * @param <B> the second value type * @return the new instance */ public static <A, B> Pair<A, B> create(A a, B b) { return new Pair<A, B>(a, b); }
final int idx = instanceCache.size(); instanceCache.add(UNRESOLVED); final Object obj = Pair.create(doReadNestedObject(unshared, "java.util.marshalling.Pair [A]"), doReadNestedObject(unshared, "java.util.marshalling.Pair [B]")); final Object resolvedObject = objectResolver.readResolve(obj); if (! unshared) {
/** * Create a new instance. * * @param a the first value * @param b the second value */ public Pair(final A a, final B b) { this.a = a; this.b = b; hashCode = hashCode(a, b); }