/** * Appends the specified collection to this set of collections. * * @param c The collection to append to this set of collections. * @return This object (for method chaining). */ public MultiSet<E> append(Collection<E> c) { assertFieldNotNull(c, "c"); l.add(c); return this; }
private IOPipe(Object input, Object output) { assertFieldNotNull(input, "input"); assertFieldNotNull(output, "output"); if (input instanceof InputStream || input instanceof Reader || input instanceof File || input instanceof byte[] || input instanceof CharSequence || input == null) this.input = input; else illegalArg("Invalid input class type. Must be one of the following: InputStream, Reader, CharSequence, byte[], File"); if (output instanceof OutputStream || output instanceof Writer) this.output = output; else illegalArg("Invalid output class type. Must be one of the following: OutputStream, Writer"); }
/** * Specifies the temporary buffer size. * * @param buffSize The buffer size. Default is <code>1024</code>. * @return This object (for method chaining). */ public IOPipe buffSize(int buffSize) { assertFieldPositive(buffSize, "buffSize"); this.buffSize = buffSize; return this; }
/** * Constructor. * * @param name The name of this variable. * @param m The map to pull values from. */ public MapVar(String name, Map m) { super(name); if (m == null) illegalArg("''m'' parameter cannot be null."); this.m = m; }
/** * Add another bundle path to this resource bundle. * * <p> * Order of property lookup is first-to-last. * * <p> * This method must be called from the same thread as the call to the constructor. * This eliminates the need for synchronization. * * @param forClass The class using this resource bundle. * @param bundlePath The bundle path. * @return This object (for method chaining). */ public MessageBundle addSearchPath(Class<?> forClass, String bundlePath) { assertSameThread(creationThreadId, "This method can only be called from the same thread that created the object."); MessageBundle srb = new MessageBundle(forClass, bundlePath); if (srb.rb != null) { allKeys.addAll(srb.keySet()); searchBundles.add(srb); } return this; }
/** * Constructor. * * @param name The name of this variable. * @param m The map to pull values from. */ public MapVar(String name, Map m) { super(name); if (m == null) illegalArg("''m'' parameter cannot be null."); this.m = m; }
/** * Add another bundle path to this resource bundle. * * <p> * Order of property lookup is first-to-last. * * <p> * This method must be called from the same thread as the call to the constructor. * This eliminates the need for synchronization. * * @param forClass The class using this resource bundle. * @param bundlePath The bundle path. * @return This object (for method chaining). */ public MessageBundle addSearchPath(Class<?> forClass, String bundlePath) { assertSameThread(creationThreadId, "This method can only be called from the same thread that created the object."); MessageBundle srb = new MessageBundle(forClass, bundlePath); if (srb.rb != null) { allKeys.addAll(srb.keySet()); searchBundles.add(srb); } return this; }
/** * Appends the specified iterator to this list of iterators. * * @param iterator The iterator to append. * @return This object (for method chaining). */ public MultiIterable<E> append(Iterator<E> iterator) { assertFieldNotNull(iterator, "iterator"); this.iterators.add(iterator); return this; }
private IOPipe(Object input, Object output) { assertFieldNotNull(input, "input"); assertFieldNotNull(output, "output"); if (input instanceof InputStream || input instanceof Reader || input instanceof File || input instanceof byte[] || input instanceof CharSequence || input == null) this.input = input; else illegalArg("Invalid input class type. Must be one of the following: InputStream, Reader, CharSequence, byte[], File"); if (output instanceof OutputStream || output instanceof Writer) this.output = output; else illegalArg("Invalid output class type. Must be one of the following: OutputStream, Writer"); }
/** * Constructor. * * @param name The name of this variable. * @param m The map to pull values from. */ public MapVar(String name, Map m) { super(name); if (m == null) illegalArg("''m'' parameter cannot be null."); this.m = m; }
/** * Specifies the temporary buffer size. * * @param buffSize The buffer size. Default is <code>1024</code>. * @return This object (for method chaining). */ public IOPipe buffSize(int buffSize) { assertFieldPositive(buffSize, "buffSize"); this.buffSize = buffSize; return this; }
/** * Add another bundle path to this resource bundle. * * <p> * Order of property lookup is first-to-last. * * <p> * This method must be called from the same thread as the call to the constructor. * This eliminates the need for synchronization. * * @param forClass The class using this resource bundle. * @param bundlePath The bundle path. * @return This object (for method chaining). */ public MessageBundle addSearchPath(Class<?> forClass, String bundlePath) { assertSameThread(creationThreadId, "This method can only be called from the same thread that created the object."); MessageBundle srb = new MessageBundle(forClass, bundlePath); if (srb.rb != null) { allKeys.addAll(srb.keySet()); searchBundles.add(srb); } return this; }
/** * Appends the specified iterator to this list of iterators. * * @param iterator The iterator to append. * @return This object (for method chaining). */ public MultiIterable<E> append(Iterator<E> iterator) { assertFieldNotNull(iterator, "iterator"); this.iterators.add(iterator); return this; }
private IOPipe(Object input, Object output) { assertFieldNotNull(input, "input"); assertFieldNotNull(output, "output"); if (input instanceof InputStream || input instanceof Reader || input instanceof File || input instanceof byte[] || input instanceof CharSequence || input == null) this.input = input; else illegalArg("Invalid input class type. Must be one of the following: InputStream, Reader, CharSequence, byte[], File"); if (output instanceof OutputStream || output instanceof Writer) this.output = output; else illegalArg("Invalid output class type. Must be one of the following: OutputStream, Writer"); }
@Override /* MultipartVar */ public String resolve(VarResolverSession session, String[] args) { if (args.length < 3) illegalArg("Invalid number of arguments passed to $PR var. Must have 3 or more arguments."); String stringArg = args[0]; String pattern = args[1]; String replace = args[2]; pattern = pattern.replace("*", ".*").replace("?", "."); return stringArg.replaceAll(pattern, replace); } }
/** * Specifies the temporary buffer size. * * @param buffSize The buffer size. Default is <code>1024</code>. * @return This object (for method chaining). */ public IOPipe buffSize(int buffSize) { assertFieldPositive(buffSize, "buffSize"); this.buffSize = buffSize; return this; }
/** * Appends the specified collection to this set of collections. * * @param c The collection to append to this set of collections. * @return This object (for method chaining). */ public MultiSet<E> append(Collection<E> c) { assertFieldNotNull(c, "c"); l.add(c); return this; }
/** * Constructor. * * @param keys The map keys. Must not be <jk>null</jk>. * @param values The map values. Must not be <jk>null</jk>. */ public SimpleMap(String[] keys, Object[] values) { assertFieldNotNull(keys, "keys"); assertFieldNotNull(values, "values"); if (keys.length != values.length) illegalArg("keys ''{0}'' and values ''{1}'' array lengths differ", keys.length, values.length); this.keys = keys; this.values = values; entries = new SimpleMapEntry[keys.length]; for (int i = 0; i < keys.length; i++) { if (keys[i] == null) illegalArg("Keys array cannot contain a null value."); entries[i] = new SimpleMapEntry(i); } }
@Override /* MultipartVar */ public String resolve(VarResolverSession session, String[] args) { if (args.length < 3) illegalArg("Invalid number of arguments passed to $PR var. Must have 3 or more arguments."); String stringArg = args[0]; String pattern = args[1]; String replace = args[2]; pattern = pattern.replace("*", ".*").replace("?", "."); return stringArg.replaceAll(pattern, replace); } }
/** * Appends the specified iterator to this list of iterators. * * @param iterator The iterator to append. * @return This object (for method chaining). */ public MultiIterable<E> append(Iterator<E> iterator) { assertFieldNotNull(iterator, "iterator"); this.iterators.add(iterator); return this; }