All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.g2forge.alexandria.java.tuple.implementations.Tuple2GSO Maven / Gradle / Ivy

There is a newer version: 0.0.18
Show newest version
package com.g2forge.alexandria.java.tuple.implementations;

import java.util.Objects;

import com.g2forge.alexandria.java.tuple.ITuple2GS;

public class Tuple2GSO extends Tuple1GSO implements ITuple2GS {
	protected T1 value1;

	public Tuple2GSO() {
		this(null, null);
	}

	public Tuple2GSO(final T0 value0, final T1 value1) {
		super(value0);
		this.value1 = value1;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) return true;
		if (!super.equals(obj)) return false;
		if (getClass() != obj.getClass()) return false;

		final Tuple2G_O that = (Tuple2G_O) obj;
		return Objects.equals(get0(), that.get0()) && Objects.equals(get1(), that.get1());
	}

	@Override
	public T1 get1() {
		return value1;
	}

	@Override
	public int hashCode() {
		return Objects.hash(get0(), get1());
	}

	@Override
	public ITuple2GS set0(final T0 value) {
		value0 = value;
		return this;
	}

	@Override
	public ITuple2GS set1(final T1 value) {
		this.value1 = value;
		return this;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy