/** * Creates a new ID map with integer keys with generator initialized to the specified value. * * @param c The value type. * @param initValue The initial value of the generator. * @return A new map. */ public static <T> IdMap<Integer,T> createIntMap(Class<T> c, int initValue) { return create(c, IdGenerators.createIntGenerator(initValue)); }
/** * Creates a new ID map with long keys with generator initialized to the specified value. * * @param c The value type. * @param initValue The initial value of the generator. * @return A new map. */ public static <T> IdMap<Long,T> createLongMap(Class<T> c, long initValue) { return create(c, IdGenerators.createLongGenerator(initValue)); }
/** * Creates an empty map. * * @return A new empty map. */ public static <K,V> AMap<K,V> create() { return new AMap<>(); }
@Test public void testAddressBook() { PojoRest model; model = new PojoRest(new AddressBook()); // Try adding a person to the address book. Person billClinton = new Person("Bill Clinton", 65, new Address("55W. 125th Street", "New York", "NY", 10027, true) ); model.post("/", billClinton); // Make sure we get the original person back. billClinton = (Person)model.get("/0"); }
public A init() { f1 = AEnum.FOO; f2 = AEnum.BAR; f3 = new AEnum[]{AEnum.FOO,null}; f4 = new AEnum[][]{{AEnum.FOO,null},null}; f5 = new AList<AEnum>().append(AEnum.FOO); f6 = new AList<AEnum>().append(AEnum.FOO); f7 = new ASet<AEnum>().append(AEnum.FOO); f8 = new ASet<AEnum>().append(AEnum.FOO); return this; } }
/** * Creates a process builder with the specified arguments. * * <p> * Equivalent to calling <code>ProcessBuilder.create().command(args);</code> * * @param args The command-line arguments. * @return A new process builder. */ public static ProcBuilder create(Object...args) { return new ProcBuilder().command(args); }
/** * Retrieves the element addressed by the URL. * * @param url * The URL of the element to retrieve. * <br>If <jk>null</jk> or blank, returns the root. * @return The addressed element, or <jk>null</jk> if that element does not exist in the tree. */ public Object get(String url) { return getWithDefault(url, null); }
/** * Adds an entry to this map. * * @param k The key. * @param v The value. * @return This object (for method chaining). */ public AMap<K,V> append(K k, V v) { put(k, v); return this; } }
/** * Returns 'true' if this integer matches the pattern(s). */ @Override /* IMatcher */ public boolean matches(Number in) { for (int i = 0; i < numberPatterns.length; i++) { if (! numberPatterns[i].matches(in)) return false; } return true; }
/** * Creates an ID generator using {@link AtomicLong} initialized to the specified value. * * @return A new ID generator. */ public static IdGenerator<Long> createLongGenerator() { return createLongGenerator(1); } }
/** * Constructor. * * <p> * Uses default {@link ClasspathResourceFinderBasic} for finding resources. * * @param baseClass The default class to use for retrieving resources from the classpath. */ public ClasspathResourceManager(Class<?> baseClass) { this(baseClass, new ClasspathResourceFinderBasic(), false); }
/** * Sets a lower bound on the specified ID. * @param k The lower-bound key. */ public void lbId(K k) { idGen.lb(k); } }
/** * Returns the language-specified extended metadata on this class. * * @param c The name of the metadata class to create. * @return Extended metadata on this class. Never <jk>null</jk>. */ public <M extends ClassMetaExtended> M getExtendedMeta(Class<M> c) { return extMeta.get(c, this); }
@Test public void testConstructors() throws Exception { PojoRest model = new PojoRest(new AddressBook(), JsonParser.DEFAULT); // Try adding a person to the address book. Person billClinton = new Person("Bill Clinton", 65, new Address("55W. 125th Street", "New York", "NY", 10027, true) ); model.post("/", billClinton); // Make sure we get the original person back. billClinton = (Person)model.get("/0"); }
public B init() { f1 = BEnum.FOO; f2 = BEnum.BAR; f3 = new BEnum[]{BEnum.FOO,null}; f4 = new BEnum[][]{{BEnum.FOO,null},null}; f5 = new AList<BEnum>().append(BEnum.FOO); f6 = new AList<BEnum>().append(BEnum.FOO); f7 = new ASet<BEnum>().append(BEnum.FOO); f8 = new ASet<BEnum>().append(BEnum.FOO); return this; } }
/** * Creates a new ID map with integer keys with generator initialized to the specified value. * * @param c The value type. * @param initValue The initial value of the generator. * @return A new map. */ public static <T> IdMap<Integer,T> createIntMap(Class<T> c, int initValue) { return create(c, IdGenerators.createIntGenerator(initValue)); }
/** * Creates a new ID map with long keys with generator initialized to the specified value. * * @param c The value type. * @param initValue The initial value of the generator. * @return A new map. */ public static <T> IdMap<Long,T> createLongMap(Class<T> c, long initValue) { return create(c, IdGenerators.createLongGenerator(initValue)); }
/** * Creates a new ID map with integer keys with generator initialized to the specified value. * * @param c The value type. * @param initValue The initial value of the generator. * @return A new map. */ public static <T> IdMap<Integer,T> createIntMap(Class<T> c, int initValue) { return create(c, IdGenerators.createIntGenerator(initValue)); }
/** * Creates a new ID map with long keys with generator initialized to the specified value. * * @param c The value type. * @param initValue The initial value of the generator. * @return A new map. */ public static <T> IdMap<Long,T> createLongMap(Class<T> c, long initValue) { return create(c, IdGenerators.createLongGenerator(initValue)); }