- java.lang.Object
-
- util.misc.BooleanResult
-
public class BooleanResult extends java.lang.Object
A class with multiple boolean values.- Since:
- 4.2.2
- Author:
- René Mach
-
-
Constructor Summary
Constructors Constructor Description BooleanResult(boolean... values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getResultCount()
Gets the number of the results contained by this BooleanResult.boolean
getResultForIndex(java.lang.Integer index)
Gets the boolean value for the result with the given index.boolean
getResultForName(java.lang.String name)
Gets the boolean value for the result with the given name.boolean[]
getResults()
Gets an array with the result values.boolean
isAllFalse()
Gets if all boolean results contained arefalse
boolean
isAllTrue()
Gets if all boolean results contained aretrue
boolean
isPartlyTrue()
Gets if at least one boolean results contained istrue
void
setResultNames(java.lang.String... names)
Sets the names for the result values, so it later can be used to acquire the result value for the name.java.lang.String
toString()
-
-
-
Method Detail
-
setResultNames
public void setResultNames(java.lang.String... names)
Sets the names for the result values, so it later can be used to acquire the result value for the name.- Parameters:
names
- The names to set.
-
getResultCount
public int getResultCount()
Gets the number of the results contained by this BooleanResult.- Returns:
- The number of the available results.
-
getResults
public boolean[] getResults()
Gets an array with the result values.- Returns:
- The array with the result values.
-
getResultForIndex
public boolean getResultForIndex(java.lang.Integer index)
Gets the boolean value for the result with the given index.- Parameters:
index
- The index to get the boolean value for.- Returns:
true
if the index exists and the result value istrue
,false
otherwise.
-
getResultForName
public boolean getResultForName(java.lang.String name)
Gets the boolean value for the result with the given name.- Parameters:
name
- The name of the boolean value to get.- Returns:
true
if the name exists and the result value istrue
,false
otherwise.
-
isAllTrue
public boolean isAllTrue()
Gets if all boolean results contained aretrue
- Returns:
true
if all values contained aretrue
,false
otherwise.
-
isAllFalse
public boolean isAllFalse()
Gets if all boolean results contained arefalse
- Returns:
true
if all values contained arefalse
,false
otherwise.
-
isPartlyTrue
public boolean isPartlyTrue()
Gets if at least one boolean results contained istrue
- Returns:
true
if at least one value contained istrue
,false
otherwise.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-