Skip to content

Commit 9400a62

Browse files
committed
Result errors and warning accessory methods
1 parent d266c2f commit 9400a62

File tree

1 file changed

+20
-1
lines changed
  • fj-core/src/main/java/org/fugerit/java/core/lang/helpers

1 file changed

+20
-1
lines changed

fj-core/src/main/java/org/fugerit/java/core/lang/helpers/Result.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import java.io.PrintStream;
44
import java.util.ArrayList;
5+
import java.util.Collection;
6+
import java.util.Collections;
57
import java.util.List;
68

79
/**
@@ -95,5 +97,22 @@ public Result() {
9597
this.fatalList = new ArrayList<Exception>();
9698
this.warningList = new ArrayList<Exception>();
9799
}
98-
100+
101+
public Collection<Exception> errors() {
102+
return Collections.unmodifiableCollection( this.errorList );
103+
}
104+
105+
public Collection<Exception> fatals() {
106+
return Collections.unmodifiableCollection( this.fatalList );
107+
}
108+
109+
public Collection<Exception> warnings() {
110+
return Collections.unmodifiableCollection( this.warningList );
111+
}
112+
113+
114+
public Collection<Exception> fatalsAndErrors() {
115+
return Collections.unmodifiableCollection( CollectionUtils.merge( new ArrayList<Exception>( this.fatalList ) , this.errorList ) );
116+
}
117+
99118
}

0 commit comments

Comments
 (0)