Package com.telenordigital.nbiot
Class ImmutableTeamList
- java.lang.Object
-
- com.telenordigital.nbiot.ImmutableTeamList
-
- All Implemented Interfaces:
Team.TeamList
@ParametersAreNonnullByDefault @Immutable public final class ImmutableTeamList extends Object implements Team.TeamList
Immutable implementation ofTeam.TeamList.Use the builder to create immutable instances:
new ImmutableTeamList.Builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTeamList.BuilderBuilds instances of typeImmutableTeamList.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTeamListcopyOf(Team.TeamList instance)Creates an immutable copy of aTeam.TeamListvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableTeamListthat have equal attribute values.inthashCode()Computes a hash code from attributes:teams.Team[]teams()StringtoString()Prints the immutable valueTeamListwith attribute values.ImmutableTeamListwithTeams(Team... elements)Copy the current immutable object with elements that replace the content ofteams.
-
-
-
Method Detail
-
teams
@Nullable public Team[] teams()
- Specified by:
teamsin interfaceTeam.TeamList- Returns:
- A cloned
teamsarray
-
withTeams
public final ImmutableTeamList withTeams(@Nullable Team... elements)
Copy the current immutable object with elements that replace the content ofteams. The array is cloned before being saved as attribute values.- Parameters:
elements- The non-null elements for teams- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableTeamListthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:teams.
-
toString
public String toString()
Prints the immutable valueTeamListwith attribute values.
-
copyOf
public static ImmutableTeamList copyOf(Team.TeamList instance)
Creates an immutable copy of aTeam.TeamListvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable TeamList instance
-
-