Package com.karuslabs.elementary
Class Finder
java.lang.Object
com.karuslabs.elementary.Finder
- All Implemented Interfaces:
Iterable<Diagnostic<? extends JavaFileObject>>
Filter and maps the results of a compilation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionat(long column) Retains only diagnostic messages that appear at the given column.codes()Return the codes of the diagnostic messages.columns()Returns the column numbers of the diagnostic messages.Retain only diagnostic messages that contain the given substring.intcount()Returns the current count of diagnostic messages.Returns the full descriptions of the diagnostic messages.errors()Retains only errors.in(JavaFileObject file) Retains only diagnostic messages in the given Java source file.Iterator<Diagnostic<? extends JavaFileObject>>iterator()Returns an iterator overDiagnostic<? extends JavaFileObject>s.kind(Collection<Diagnostic.Kind> kinds) Removes all diagnostic messages which kind does not match the given kinds.kind(Diagnostic.Kind... kinds) Removes all diagnostic messages which kind does not match the given kinds.lines()Returns the line numbers of the diagnostic messages.List<Diagnostic<? extends JavaFileObject>>list()Returns the diagnostic messages.Map<Diagnostic.Kind,List<Diagnostic<? extends JavaFileObject>>> map()Returns a map of diagnostic messages and associatedKinds.Retains only diagnostic messages that exactly match the given message.Retain only diagnostic messages that match the given pattern.messages()Returns only the message portions of the diagnostic messages.notes()Retains only notes.on(long line) Retains only diagnostic messages that appear on the given line.@Nullable Diagnostic<? extends JavaFileObject>one()Returns the diagnostic message if thisFindercontains exactly one diagnostic message.Return the positions of the diagnostic messages from the start of a source file.warnings()Retains only warnings.where(Predicate<Diagnostic<? extends JavaFileObject>> condition) Retains only diagnostic messages that satisfy the given predicate.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Finder
Creates aFinderfor the given results.- Parameters:
results- the results of a compilation
-
-
Method Details
-
iterator
Returns an iterator overDiagnostic<? extends JavaFileObject>s.- Specified by:
iteratorin interfaceIterable<Diagnostic<? extends JavaFileObject>>- Returns:
- an iterator
-
kind
Removes all diagnostic messages which kind does not match the given kinds.- Parameters:
kinds- the kinds which all diagnostic messages should match- Returns:
this
-
kind
Removes all diagnostic messages which kind does not match the given kinds.- Parameters:
kinds- the kinds which all diagnostic messages should match- Returns:
this
-
errors
Retains only errors.- Returns:
this
-
warnings
Retains only warnings.- Returns:
this
-
notes
Retains only notes.- Returns:
this
-
in
Retains only diagnostic messages in the given Java source file.- Parameters:
file- the Java source file- Returns:
this
-
on
Retains only diagnostic messages that appear on the given line.- Parameters:
line- the line- Returns:
this
-
at
Retains only diagnostic messages that appear at the given column.- Parameters:
column- the column- Returns:
this
-
where
Retains only diagnostic messages that satisfy the given predicate.- Parameters:
condition- the condition- Returns:
this
-
matches
Retains only diagnostic messages that exactly match the given message.- Parameters:
message- the message- Returns:
this
-
matches
Retain only diagnostic messages that match the given pattern.- Parameters:
pattern- the pattern- Returns:
this
-
contains
Retain only diagnostic messages that contain the given substring.- Parameters:
substring- the substring- Returns:
this
-
diagnostics
Returns the full descriptions of the diagnostic messages.- Returns:
- the full descriptions
-
messages
Returns only the message portions of the diagnostic messages.- Returns:
- the message portions
-
lines
Returns the line numbers of the diagnostic messages.- Returns:
- the line numbers
-
columns
Returns the column numbers of the diagnostic messages.- Returns:
- the column numbers
-
positions
Return the positions of the diagnostic messages from the start of a source file.- Returns:
- the positions
-
codes
Return the codes of the diagnostic messages.- Returns:
- the codes
-
one
Returns the diagnostic message if thisFindercontains exactly one diagnostic message. Otherwise returnsnull.- Returns:
- the diagnostic message if this
Findermatches exactly one diagnostic message
-
list
Returns the diagnostic messages.- Returns:
- the diagnostic messages
-
map
Returns a map of diagnostic messages and associatedKinds.- Returns:
- the map
-
count
public int count()Returns the current count of diagnostic messages.- Returns:
- the current count of diagnostic messages
-