1 20 21 package net.innig.macker.event; 22 23 import net.innig.macker.rule.Rule; 24 25 import java.util.*; 26 27 public class MackerIsMadException 28 extends Exception 29 { 30 public MackerIsMadException() 31 { 32 super(); 33 events = null; 34 } 35 36 public MackerIsMadException(MackerEvent event) 37 { this(Collections.singletonList(event)); } 38 39 public MackerIsMadException(List events) 40 { 41 super(BASE_MESSAGE); 42 if(events.isEmpty()) 43 throw new IllegalArgumentException ("Macker needs a non-empty list of things to be mad about."); 44 this.events = Collections.unmodifiableList(new ArrayList(events)); 45 } 46 47 public List getEvents() 48 { return events; } 49 50 private final List events; 51 52 private static final String BASE_MESSAGE = "Macker rules checking failed"; 53 } 54 55 | Popular Tags |