Refine search
@Override public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); Validate.notNull(alias, "Alias cannot be null"); return ImmutableList.of(); } }
/** * Create a new potion of the given type and level. * * @param type The type of potion. * @param level The potion's level. */ public Potion(PotionType type, int level) { this(type); Validate.notNull(type, "Type cannot be null"); Validate.isTrue(type != PotionType.WATER, "Water bottles don't have a level!"); Validate.isTrue(level > 0 && level < 3, "Level must be 1 or 2"); this.level = level; }
/** * Constructor. * * @param legs List of legs for this itinerary. */ public Itinerary(final List<Leg> legs) { Validate.notEmpty(legs); Validate.noNullElements(legs); this.legs = legs; }
Schedule(final List<CarrierMovement> carrierMovements) { Validate.notNull(carrierMovements); Validate.noNullElements(carrierMovements); Validate.notEmpty(carrierMovements); this.carrierMovements = carrierMovements; }
/** * Prefix list is used to do file filtering. * * @param prefixes the prefixes with separators * @param separator the separator to split the prefixes */ public PrefixList(String prefixes, String separator) { Validate.notNull(separator); List<String> prefixList = new ArrayList<>(0); if (prefixes != null && !prefixes.trim().isEmpty()) { String[] candidates = prefixes.trim().split(separator); for (String prefix : candidates) { String trimmed = prefix.trim(); if (!trimmed.isEmpty()) { prefixList.add(trimmed); } } } mInnerList = ImmutableList.copyOf(prefixList); }
/** * Add a fade color to the firework effect. * * @param color The color to add * @return This object, for chaining * @throws IllegalArgumentException If colors is null * @throws IllegalArgumentException If any color is null (may be * thrown after changes have occurred) */ public Builder withFade(Color color) throws IllegalArgumentException { Validate.notNull(color, "Cannot have null color"); if (fadeColors == null) { fadeColors = ImmutableList.builder(); } fadeColors.add(color); return this; }
/** * Creates a new note. * * @param note Internal note id. {@link #getId()} always return this * value. The value has to be in the interval [0; 24]. */ public Note(int note) { Validate.isTrue(note >= 0 && note <= 24, "The note value has to be between 0 and 24."); this.note = (byte) note; }
/** * AbstractMongoBolt Constructor. * @param url The MongoDB server url * @param collectionName The collection where reading/writing data */ public AbstractMongoBolt(String url, String collectionName) { Validate.notEmpty(url, "url can not be blank or null"); Validate.notEmpty(collectionName, "collectionName can not be blank or null"); this.url = url; this.collectionName = collectionName; }
public EntityDamageEvent(final Entity damagee, final DamageCause cause, final Map<DamageModifier, Double> modifiers, final Map<DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions) { super(damagee); Validate.isTrue(modifiers.containsKey(DamageModifier.BASE), "BASE DamageModifier missing"); Validate.isTrue(!modifiers.containsKey(null), "Cannot have null DamageModifier"); Validate.noNullElements(modifiers.values(), "Cannot have null modifier values"); Validate.isTrue(modifiers.keySet().equals(modifierFunctions.keySet()), "Must have a modifier function for each DamageModifier"); Validate.noNullElements(modifierFunctions.values(), "Cannot have null modifier function"); this.originals = new EnumMap<DamageModifier, Double>(modifiers); this.cause = cause; this.modifiers = modifiers; this.modifierFunctions = modifierFunctions; }
public Leg(Voyage voyage, Location loadLocation, Location unloadLocation, Date loadTime, Date unloadTime) { Validate.noNullElements(new Object[] {voyage, loadLocation, unloadLocation, loadTime, unloadTime}); this.voyage = voyage; this.loadLocation = loadLocation; this.unloadLocation = unloadLocation; this.loadTime = loadTime; this.unloadTime = unloadTime; }
public HBaseLookupBolt(String tableName, HBaseMapper mapper, HBaseValueMapper rowToTupleMapper) { super(tableName, mapper); Validate.notNull(rowToTupleMapper, "rowToTupleMapper can not be null"); this.rowToTupleMapper = rowToTupleMapper; }
private Color(int red, int green, int blue) { Validate.isTrue(red >= 0 && red <= BIT_MASK, "Red is not between 0-255: ", red); Validate.isTrue(green >= 0 && green <= BIT_MASK, "Green is not between 0-255: ", green); Validate.isTrue(blue >= 0 && blue <= BIT_MASK, "Blue is not between 0-255: ", blue); this.red = (byte) red; this.green = (byte) green; this.blue = (byte) blue; }
/** * <p>Validate that the specified argument collection is neither <code>null</code> * nor a size of zero (no elements); otherwise throwing an exception. * * <pre>Validate.notEmpty(myCollection);</pre> * * <p>The message in the exception is "The validated collection is * empty".</p> * * @param collection the collection to check * @throws IllegalArgumentException if the collection is empty */ public static void notEmpty(Collection collection) { notEmpty(collection, "The validated collection is empty"); }
/** * Constructor. * * @param departureLocation location of departure * @param arrivalLocation location of arrival * @param departureTime time of departure * @param arrivalTime time of arrival */ // TODO make package local public CarrierMovement(Location departureLocation, Location arrivalLocation, Date departureTime, Date arrivalTime) { Validate.noNullElements(new Object[]{departureLocation, arrivalLocation, departureTime, arrivalTime}); this.departureTime = departureTime; this.arrivalTime = arrivalTime; this.departureLocation = departureLocation; this.arrivalLocation = arrivalLocation; }
@Override public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); Validate.notNull(alias, "Alias cannot be null"); return ImmutableList.of(); } }
/** * Gets the color represented by the specified color code * * @param code Code to check * @return Associative {@link org.bukkit.ChatColor} with the given code, * or null if it doesn't exist */ public static ChatColor getByChar(String code) { Validate.notNull(code, "Code cannot be null"); Validate.isTrue(code.length() > 0, "Code must have at least one char"); return BY_CHAR.get(code.charAt(0)); }
protected MongoMapState(Map<String, Object> map, Options options) { this.options = options; this.map = map; this.serializer = options.serializer; Validate.notEmpty(options.url, "url can not be blank or null"); Validate.notEmpty(options.collectionName, "collectionName can not be blank or null"); Validate.notNull(options.queryCreator, "queryCreator can not be null"); Validate.notNull(options.mapper, "mapper can not be null"); this.mongoClient = new MongoDbClient(options.url, options.collectionName); }
/** * MongoInsertBolt Constructor. * @param url The MongoDB server url * @param collectionName The collection where reading/writing data * @param mapper MongoMapper converting tuple to an MongoDB document */ public MongoInsertBolt(String url, String collectionName, MongoMapper mapper) { super(url, collectionName); Validate.notNull(mapper, "MongoMapper can not be null"); this.mapper = mapper; }