Class FlowValidationProblemList
- java.lang.Object
-
- com.tibco.ep.tcs.runtime.FlowValidationProblemList
-
- All Implemented Interfaces:
Iterable<FlowValidationProblem>
,Collection<FlowValidationProblem>
public class FlowValidationProblemList extends Object implements Iterable<FlowValidationProblem>, Collection<FlowValidationProblem>
A validation problem list. The list differentiates between errors and warnings and can retrieve and format them separately.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
FlowValidationProblemList.FlowValidationException
An inner class for flow validation exceptions.
-
Constructor Summary
Constructors Constructor Description FlowValidationProblemList()
Create a new empty validation problem list.FlowValidationProblemList(FlowValidationProblemList problemList)
Create a new validation problem list from the specified one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(FlowValidationProblem toAdd)
Add a validation problem to the list.boolean
addAll(Collection<? extends FlowValidationProblem> c)
Add all of the problems in the specified collection to this list.void
clear()
Remove all of the elements from this list.boolean
contains(Object o)
Returntrue
if this collection contains the specified element.boolean
containsAll(Collection<?> c)
Returntrue
if this collection contains all of the elements in the specified collection.boolean
equals(Object o)
Return true if the specified list is equal to this list, false otherwise.FlowValidationProblem
getError(int n)
Return the Nth error.int
getErrorCount()
Return this problem list's error count.List<FlowValidationProblem>
getErrors()
Return a copy of this problem list's errors.String
getErrorsAsString()
Return this list's errors as a comma-separated list.String
getErrorsAsString(String prefix, String separator, String suffix)
Return this list's errors as a list with specified prefix, separator, and suffix sequences.List<String>
getFormattedErrors()
Return a list of formatted errors as strings.List<String>
getFormattedProblems()
Return a list of formatted problems as strings.List<String>
getFormattedWarnings()
Return a list of formatted warnings as strings.String
getProblemsAsString()
Return this list's problems as a comma-separated list.String
getProblemsAsString(String prefix, String separator, String suffix)
Return this list's problems as a list with specified prefix, separator, and suffix sequences.FlowValidationProblem
getWarning(int n)
Return the Nth warning.int
getWarningCount()
Return this problem list's warning count.List<FlowValidationProblem>
getWarnings()
Return a copy of this problem list's warnings.String
getWarningsAsString()
Return this list's warnings as a comma-separated list.String
getWarningsAsString(String prefix, String separator, String suffix)
Return this list's warnings as a list with specified prefix, separator, and suffix sequences.boolean
hasErrors()
Return true if this problem list contains errors, false otherwise.int
hashCode()
Returns the hash code value for this collection.boolean
hasWarnings()
Return true if this problem list contains warnings, false otherwise.boolean
isEmpty()
Returntrue
if this collection contains no elements.Iterator<FlowValidationProblem>
iterator()
Return an iterator over this list.boolean
remove(Object o)
Remove the first occurrence of the specified element from this list, if it is present.boolean
removeAll(Collection<?> c)
Remove all occurrences of the elements in the specified collection from this list, if they are present.boolean
retainAll(Collection<?> c)
Retain only the elements in this collection that are contained in the specified collection (optional operation).int
size()
Return the list size.Object[]
toArray()
Return an array containing all of the elements in this list in order.<ValidationProblem>
ValidationProblem[]toArray(ValidationProblem[] a)
Return an array containing all of the elements in this list in order.FlowValidationProblemList.FlowValidationException
toException()
Return an exception containing all problems as a single long string, each separated by a newline.String
toString()
Return the list in string form.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Constructor Detail
-
FlowValidationProblemList
public FlowValidationProblemList()
Create a new empty validation problem list.
-
FlowValidationProblemList
public FlowValidationProblemList(FlowValidationProblemList problemList)
Create a new validation problem list from the specified one.
- Parameters:
problemList
- problem list source, null if none
-
-
Method Detail
-
hasErrors
public boolean hasErrors()
Return true if this problem list contains errors, false otherwise.
- Returns:
- true if there are errors, false otherwise
-
hasWarnings
public boolean hasWarnings()
Return true if this problem list contains warnings, false otherwise.
- Returns:
- true if there are warnings, false otherwise
-
getErrorCount
public int getErrorCount()
Return this problem list's error count.
- Returns:
- error count
-
getWarningCount
public int getWarningCount()
Return this problem list's warning count.
- Returns:
- warning count
-
getErrors
public List<FlowValidationProblem> getErrors()
Return a copy of this problem list's errors.
- Returns:
- error list
-
getError
public FlowValidationProblem getError(int n)
Return the Nth error.
- Parameters:
n
- index- Returns:
- error
-
getWarnings
public List<FlowValidationProblem> getWarnings()
Return a copy of this problem list's warnings.
- Returns:
- warning list
-
getWarning
public FlowValidationProblem getWarning(int n)
Return the Nth warning.
- Parameters:
n
- index- Returns:
- warning
-
getFormattedProblems
public List<String> getFormattedProblems()
Return a list of formatted problems as strings.
- Returns:
- formatted problem list
-
getFormattedErrors
public List<String> getFormattedErrors()
Return a list of formatted errors as strings.
- Returns:
- formatted error list
-
getFormattedWarnings
public List<String> getFormattedWarnings()
Return a list of formatted warnings as strings.
- Returns:
- formatted warning list
-
getProblemsAsString
public String getProblemsAsString()
Return this list's problems as a comma-separated list.
- Returns:
- the problems
-
getProblemsAsString
public String getProblemsAsString(String prefix, String separator, String suffix)
Return this list's problems as a list with specified prefix, separator, and suffix sequences.
- Parameters:
prefix
- prefix sequenceseparator
- separator sequencesuffix
- suffix sequence- Returns:
- the problems
-
getErrorsAsString
public String getErrorsAsString()
Return this list's errors as a comma-separated list.
- Returns:
- the errors
-
getErrorsAsString
public String getErrorsAsString(String prefix, String separator, String suffix)
Return this list's errors as a list with specified prefix, separator, and suffix sequences.
- Parameters:
prefix
- prefix sequenceseparator
- separator sequencesuffix
- suffix sequence- Returns:
- the errors
-
getWarningsAsString
public String getWarningsAsString()
Return this list's warnings as a comma-separated list.
- Returns:
- the warnings
-
getWarningsAsString
public String getWarningsAsString(String prefix, String separator, String suffix)
Return this list's warnings as a list with specified prefix, separator, and suffix sequences.
- Parameters:
prefix
- prefix sequenceseparator
- separator sequencesuffix
- suffix sequence- Returns:
- the warnings
-
toException
public FlowValidationProblemList.FlowValidationException toException()
Return an exception containing all problems as a single long string, each separated by a newline. If the list is empty, throw an illegal argument exception.
- Returns:
- result converted to an exception
-
toString
public String toString()
Return the list in string form.
-
iterator
public Iterator<FlowValidationProblem> iterator()
Return an iterator over this list.
- Specified by:
iterator
in interfaceCollection<FlowValidationProblem>
- Specified by:
iterator
in interfaceIterable<FlowValidationProblem>
- Returns:
- the iterator
-
add
public boolean add(FlowValidationProblem toAdd)
Add a validation problem to the list.
- Specified by:
add
in interfaceCollection<FlowValidationProblem>
- Parameters:
toAdd
- problem to add- Returns:
- true if the list was modified, false otherwise
-
addAll
public boolean addAll(Collection<? extends FlowValidationProblem> c)
Add all of the problems in the specified collection to this list. If the specified collection is null, do nothing.
- Specified by:
addAll
in interfaceCollection<FlowValidationProblem>
- Parameters:
c
- collection containing elements to be added to this list- Returns:
true
if this list changed as a result of the call
-
size
public int size()
Return the list size.
- Specified by:
size
in interfaceCollection<FlowValidationProblem>
- Returns:
- list size
-
containsAll
public boolean containsAll(Collection<?> c)
Return
true
if this collection contains all of the elements in the specified collection.- Specified by:
containsAll
in interfaceCollection<FlowValidationProblem>
- Parameters:
c
- collection to be checked for containment in this collection- Returns:
true
if this collection contains all of the elements in the specified collection
-
contains
public boolean contains(Object o)
Return
true
if this collection contains the specified element.- Specified by:
contains
in interfaceCollection<FlowValidationProblem>
- Parameters:
o
- element whose presence in this collection is to be tested- Returns:
true
if this collection contains the specified element
-
isEmpty
public boolean isEmpty()
Return
true
if this collection contains no elements.- Specified by:
isEmpty
in interfaceCollection<FlowValidationProblem>
- Returns:
true
if this collection contains no elements
-
toArray
public Object[] toArray()
Return an array containing all of the elements in this list in order.
- Specified by:
toArray
in interfaceCollection<FlowValidationProblem>
- Returns:
- an array containing all of the elements in this collection
-
toArray
public <ValidationProblem> ValidationProblem[] toArray(ValidationProblem[] a)
Return an array containing all of the elements in this list in order. The runtime type of the returned array is that of the specified array.
- Specified by:
toArray
in interfaceCollection<FlowValidationProblem>
- Parameters:
a
- the array into which the elements of this collection are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.- Returns:
- an array containing all of the elements in this collection
-
equals
public boolean equals(Object o)
Return true if the specified list is equal to this list, false otherwise. Two lists are equal if their types and contents are equal.
- Specified by:
equals
in interfaceCollection<FlowValidationProblem>
- Overrides:
equals
in classObject
- Parameters:
o
- object to compare to- Returns:
- true if equals, false otherwise
-
hashCode
public int hashCode()
Returns the hash code value for this collection. The hash code is the XOR of the hash codes of the list members.- Specified by:
hashCode
in interfaceCollection<FlowValidationProblem>
- Overrides:
hashCode
in classObject
- Returns:
- hash code
-
clear
public void clear() throws UnsupportedOperationException
Remove all of the elements from this list. This operation is not supported.
- Specified by:
clear
in interfaceCollection<FlowValidationProblem>
- Throws:
UnsupportedOperationException
- always thrown
-
remove
public boolean remove(Object o) throws UnsupportedOperationException
Remove the first occurrence of the specified element from this list, if it is present. This operation is not supported.
- Specified by:
remove
in interfaceCollection<FlowValidationProblem>
- Parameters:
o
- element to be removed from this list, if present- Returns:
true
if this list contained the specified element- Throws:
UnsupportedOperationException
- always thrown
-
removeAll
public boolean removeAll(Collection<?> c) throws UnsupportedOperationException
Remove all occurrences of the elements in the specified collection from this list, if they are present. This operation is not supported.
- Specified by:
removeAll
in interfaceCollection<FlowValidationProblem>
- Parameters:
c
- collection whose elements are to be removed from this list- Returns:
true
if the list was changed- Throws:
UnsupportedOperationException
- always thrown
-
retainAll
public boolean retainAll(Collection<?> c) throws UnsupportedOperationException
Retain only the elements in this collection that are contained in the specified collection (optional operation). This operation is not supported.
- Specified by:
retainAll
in interfaceCollection<FlowValidationProblem>
- Parameters:
c
- collection containing elements to be retained in this collection- Returns:
true
if this collection changed as a result of the call- Throws:
UnsupportedOperationException
- always thrown
-
-