1 7 8 package javax.annotation.processing; 9 10 import java.util.Arrays ; 11 12 21 public class Completions { 22 private Completions() {} 24 25 private static class SimpleCompletion implements Completion { 26 private String value; 27 private String message; 28 29 SimpleCompletion(String value, String message) { 30 if (value == null || message == null) 31 throw new NullPointerException ("Null completion strings not accepted."); 32 this.value = value; 33 this.message = message; 34 } 35 36 public String getValue() { 37 return value; 38 } 39 40 41 public String getMessage() { 42 return message; 43 } 44 45 @Override 46 public String toString() { 47 return "[\"" + value + "\", \"" + message + "\"]"; 48 } 49 } 51 52 59 public static Completion of(String value, String message) { 60 return new SimpleCompletion(value, message); 61 } 62 63 69 public static Completion of(String value) { 70 return new SimpleCompletion(value, ""); 71 } 72 } 73 | Popular Tags |