Class Pair<F extends Serializable,S extends Serializable>
java.lang.Object
org.schabi.newpipe.extractor.utils.Pair<F,S>
- Type Parameters:
F- the type of the first object, which must beSerializableS- the type of the second object, which must beSerializable
- All Implemented Interfaces:
Serializable
public class Pair<F extends Serializable,S extends Serializable>
extends Object
implements Serializable
Serializable class to create a pair of objects.
The two objects of the pair must be serializable and can be of the same
type.
Note that this class is not intended to be used as a general-purpose pair and should only be used when interfacing with the extractor.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReveals whether an object is equal to thisPairinstance.getFirst()Gets the first object of the pair.Gets the second object of the pair.inthashCode()Returns a hash code of the currentPairby using the first and second object.voidSets the first object, which must be of thePairtype.voidSets the first object, which must be of thePairtype.toString()Returns a string representation of the currentPair.
-
Constructor Details
-
Pair
Creates a newPairobject.- Parameters:
first- the first object of the pairsecond- the second object of the pair
-
-
Method Details
-
setFirst
Sets the first object, which must be of thePairtype.- Parameters:
first- the new first object of the pair
-
setSecond
Sets the first object, which must be of thePairtype.- Parameters:
second- the new first object of the pair
-
getFirst
Gets the first object of the pair.- Returns:
- the first object of the pair
-
getSecond
Gets the second object of the pair.- Returns:
- the second object of the pair
-
toString
Returns a string representation of the currentPair.The string representation will look like this:
{firstObject.toString(), secondObject.toString()} -
equals
Reveals whether an object is equal to thisPairinstance. -
hashCode
public int hashCode()Returns a hash code of the currentPairby using the first and second object.
-