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 classFlowValidationProblemList.FlowValidationExceptionAn 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 booleanadd(FlowValidationProblem toAdd)Add a validation problem to the list.booleanaddAll(Collection<? extends FlowValidationProblem> c)Add all of the problems in the specified collection to this list.voidclear()Remove all of the elements from this list.booleancontains(Object o)Returntrueif this collection contains the specified element.booleancontainsAll(Collection<?> c)Returntrueif this collection contains all of the elements in the specified collection.booleanequals(Object o)Return true if the specified list is equal to this list, false otherwise.FlowValidationProblemgetError(int n)Return the Nth error.intgetErrorCount()Return this problem list's error count.List<FlowValidationProblem>getErrors()Return a copy of this problem list's errors.StringgetErrorsAsString()Return this list's errors as a comma-separated list.StringgetErrorsAsString(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.StringgetProblemsAsString()Return this list's problems as a comma-separated list.StringgetProblemsAsString(String prefix, String separator, String suffix)Return this list's problems as a list with specified prefix, separator, and suffix sequences.FlowValidationProblemgetWarning(int n)Return the Nth warning.intgetWarningCount()Return this problem list's warning count.List<FlowValidationProblem>getWarnings()Return a copy of this problem list's warnings.StringgetWarningsAsString()Return this list's warnings as a comma-separated list.StringgetWarningsAsString(String prefix, String separator, String suffix)Return this list's warnings as a list with specified prefix, separator, and suffix sequences.booleanhasErrors()Return true if this problem list contains errors, false otherwise.inthashCode()Returns the hash code value for this collection.booleanhasWarnings()Return true if this problem list contains warnings, false otherwise.booleanisEmpty()Returntrueif this collection contains no elements.Iterator<FlowValidationProblem>iterator()Return an iterator over this list.booleanremove(Object o)Remove the first occurrence of the specified element from this list, if it is present.booleanremoveAll(Collection<?> c)Remove all occurrences of the elements in the specified collection from this list, if they are present.booleanretainAll(Collection<?> c)Retain only the elements in this collection that are contained in the specified collection (optional operation).intsize()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.FlowValidationExceptiontoException()Return an exception containing all problems as a single long string, each separated by a newline.StringtoString()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:
iteratorin interfaceCollection<FlowValidationProblem>- Specified by:
iteratorin interfaceIterable<FlowValidationProblem>- Returns:
- the iterator
-
add
public boolean add(FlowValidationProblem toAdd)
Add a validation problem to the list.
- Specified by:
addin 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:
addAllin interfaceCollection<FlowValidationProblem>- Parameters:
c- collection containing elements to be added to this list- Returns:
trueif this list changed as a result of the call
-
size
public int size()
Return the list size.
- Specified by:
sizein interfaceCollection<FlowValidationProblem>- Returns:
- list size
-
containsAll
public boolean containsAll(Collection<?> c)
Return
trueif this collection contains all of the elements in the specified collection.- Specified by:
containsAllin interfaceCollection<FlowValidationProblem>- Parameters:
c- collection to be checked for containment in this collection- Returns:
trueif this collection contains all of the elements in the specified collection
-
contains
public boolean contains(Object o)
Return
trueif this collection contains the specified element.- Specified by:
containsin interfaceCollection<FlowValidationProblem>- Parameters:
o- element whose presence in this collection is to be tested- Returns:
trueif this collection contains the specified element
-
isEmpty
public boolean isEmpty()
Return
trueif this collection contains no elements.- Specified by:
isEmptyin interfaceCollection<FlowValidationProblem>- Returns:
trueif this collection contains no elements
-
toArray
public Object[] toArray()
Return an array containing all of the elements in this list in order.
- Specified by:
toArrayin 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:
toArrayin 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:
equalsin interfaceCollection<FlowValidationProblem>- Overrides:
equalsin 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:
hashCodein interfaceCollection<FlowValidationProblem>- Overrides:
hashCodein classObject- Returns:
- hash code
-
clear
public void clear() throws UnsupportedOperationExceptionRemove all of the elements from this list. This operation is not supported.
- Specified by:
clearin 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:
removein interfaceCollection<FlowValidationProblem>- Parameters:
o- element to be removed from this list, if present- Returns:
trueif 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:
removeAllin interfaceCollection<FlowValidationProblem>- Parameters:
c- collection whose elements are to be removed from this list- Returns:
trueif 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:
retainAllin interfaceCollection<FlowValidationProblem>- Parameters:
c- collection containing elements to be retained in this collection- Returns:
trueif this collection changed as a result of the call- Throws:
UnsupportedOperationException- always thrown
-
-