/** * Convenience method for creating a list of objects. * * @param t The initial values. * @return A new list. */ public static <T> ASet<T> create(T...t) { return new ASet<T>().appendAll(t); }
/** * Convenience method for creating a list of objects. * * @param t The initial values. * @return A new list. */ public static <T> ASet<T> create(T...t) { return new ASet<T>().appendAll(t); }
/** * Convenience method for creating a list of objects. * * @param t The initial values. * @return A new list. */ public static <T> ASet<T> create(T...t) { return new ASet<T>().appendAll(t); }
/** * <mk>_enum</mk> field. * * <p> * Same as {@link #_enum(Set)} but takes in a var-args array. * * @param values * The new values for this property. * <br>Ignored if value is empty. * @return This object (for method chaining). */ public HttpPartSchemaBuilder _enum(String...values) { return _enum(new ASet<String>().appendAll(values)); }
/** * <mk>_enum</mk> field. * * <p> * Same as {@link #_enum(Set)} but takes in a var-args array. * * @param values * The new values for this property. * <br>Ignored if value is empty. * @return This object (for method chaining). */ public HttpPartSchemaBuilder _enum(String...values) { return _enum(new ASet<String>().appendAll(values)); }
/** * <mk>_enum</mk> field. * * <p> * Same as {@link #_enum(Set)} but takes in a var-args array. * * @param values * The new values for this property. * <br>Ignored if value is empty. * @return This object (for method chaining). */ public HttpPartSchemaBuilder _enum(String...values) { return _enum(new ASet<String>().appendAll(values)); }
/** * Test method for {@link SchemaInfo#setEnum(java.util.Collection)}. */ @Test public void testSetEnum() { SchemaInfo t = new SchemaInfo(); t.setEnum(new ASet<>().appendAll("foo","bar")); assertObjectEquals("['foo','bar']", t.getEnum()); assertInstanceOf(List.class, t.getEnum()); t.setEnum(new ASet<>()); assertObjectEquals("[]", t.getEnum()); assertInstanceOf(List.class, t.getEnum()); t.setEnum(null); assertNull(t.getEnum()); }
/** * Test method for {@link SchemaInfo#setAllOf(java.util.Collection)}. */ @Test public void testSetAllOf() { SchemaInfo t = new SchemaInfo(); t.setAllOf(new ASet<>().appendAll("foo","bar")); assertObjectEquals("['foo','bar']", t.getAllOf()); assertInstanceOf(List.class, t.getAllOf()); t.setAllOf(new ASet<>()); assertObjectEquals("[]", t.getAllOf()); assertInstanceOf(List.class, t.getAllOf()); t.setAllOf(null); assertNull(t.getAllOf()); }
/** * Test method for {@link Swagger#setSchemes(java.util.Collection)}. */ @Test public void testSetSchemes() { Swagger t = new Swagger(); t.setSchemes(new ASet<String>().appendAll("foo","bar")); assertObjectEquals("['foo','bar']", t.getSchemes()); assertInstanceOf(List.class, t.getSchemes()); t.setSchemes(new ASet<String>()); assertObjectEquals("[]", t.getSchemes()); assertInstanceOf(List.class, t.getSchemes()); t.setSchemes(null); assertNull(t.getSchemes()); }
/** * Test method for {@link ParameterInfo#setEnum(java.util.Collection)}. */ @Test public void testSetEnum() { ParameterInfo t = new ParameterInfo(); t.setEnum(new ASet<>().appendAll("foo","bar")); assertObjectEquals("['foo','bar']", t.getEnum()); assertInstanceOf(List.class, t.getEnum()); t.setEnum(new ASet<>()); assertObjectEquals("[]", t.getEnum()); assertInstanceOf(List.class, t.getEnum()); t.setEnum(null); assertNull(t.getEnum()); }
/** * Test method for {@link Operation#setTags(java.util.Collection)}. */ @Test public void testSetTags() { Operation t = new Operation(); t.setTags(new ASet<String>().appendAll("foo","bar")); assertObjectEquals("['foo','bar']", t.getTags()); assertInstanceOf(List.class, t.getTags()); t.setTags(new ASet<String>()); assertObjectEquals("[]", t.getTags()); assertInstanceOf(List.class, t.getTags()); t.setTags(null); assertNull(t.getTags()); }
/** * Test method for {@link Swagger#setConsumes(java.util.Collection)}. */ @Test public void testSetConsumes() { Swagger t = new Swagger(); t.setConsumes(new ASet<MediaType>().appendAll(MediaType.forString("text/foo"))); assertObjectEquals("['text/foo']", t.getConsumes()); assertInstanceOf(List.class, t.getConsumes()); t.setConsumes(new ASet<MediaType>()); assertObjectEquals("[]", t.getConsumes()); assertInstanceOf(List.class, t.getConsumes()); t.setConsumes(null); assertNull(t.getConsumes()); }
/** * Test method for {@link Operation#setConsumes(java.util.Collection)}. */ @Test public void testSetConsumes() { Operation t = new Operation(); t.setConsumes(new ASet<MediaType>().appendAll(MediaType.forString("text/foo"))); assertObjectEquals("['text/foo']", t.getConsumes()); assertInstanceOf(List.class, t.getConsumes()); t.setConsumes(new ASet<MediaType>()); assertObjectEquals("[]", t.getConsumes()); assertInstanceOf(List.class, t.getConsumes()); t.setConsumes(null); assertNull(t.getConsumes()); }
/** * Test method for {@link Swagger#setTags(java.util.Collection)}. */ @Test public void testSetTags() { Swagger t = new Swagger(); t.setTags(new ASet<Tag>().appendAll(tag("foo"))); assertObjectEquals("[{name:'foo'}]", t.getTags()); assertInstanceOf(List.class, t.getTags()); t.setTags(new ASet<Tag>()); assertObjectEquals("[]", t.getTags()); assertInstanceOf(List.class, t.getTags()); t.setTags(null); assertNull(t.getTags()); }
/** * Test method for {@link Operation#setParameters(java.util.Collection)}. */ @Test public void testSetParameters() { Operation t = new Operation(); t.setParameters(new ASet<ParameterInfo>().appendAll(parameterInfo("foo","bar"))); assertObjectEquals("[{'in':'foo',name:'bar'}]", t.getParameters()); assertInstanceOf(List.class, t.getParameters()); t.setParameters(new ASet<ParameterInfo>()); assertObjectEquals("[]", t.getParameters()); assertInstanceOf(List.class, t.getParameters()); t.setParameters(null); assertNull(t.getParameters()); }
/** * Test method for {@link Swagger#addSchemes(java.util.Collection)}. */ @Test public void testAddSchemes() { Swagger t = new Swagger(); t.addSchemes(new ASet<String>().appendAll("foo","bar")); assertObjectEquals("['foo','bar']", t.getSchemes()); assertInstanceOf(List.class, t.getSchemes()); t.addSchemes(new ASet<String>()); assertObjectEquals("['foo','bar']", t.getSchemes()); assertInstanceOf(List.class, t.getSchemes()); t.addSchemes(null); assertObjectEquals("['foo','bar']", t.getSchemes()); assertInstanceOf(List.class, t.getSchemes()); }
/** * Test method for {@link SchemaInfo#addAllOf(java.util.Collection)}. */ @Test public void testAddAllOf() { SchemaInfo t = new SchemaInfo(); t.addAllOf(new ASet<>().appendAll("foo","bar")); assertObjectEquals("['foo','bar']", t.getAllOf()); assertInstanceOf(List.class, t.getAllOf()); t.addAllOf(new ASet<>()); assertObjectEquals("['foo','bar']", t.getAllOf()); assertInstanceOf(List.class, t.getAllOf()); t.addAllOf(null); assertObjectEquals("['foo','bar']", t.getAllOf()); assertInstanceOf(List.class, t.getAllOf()); }
/** * Test method for {@link Operation#addTags(java.util.Collection)}. */ @Test public void testAddTags() { Operation t = new Operation(); t.addTags(new ASet<String>().appendAll("foo","bar")); assertObjectEquals("['foo','bar']", t.getTags()); assertInstanceOf(List.class, t.getTags()); t.addTags(new ASet<String>()); assertObjectEquals("['foo','bar']", t.getTags()); assertInstanceOf(List.class, t.getTags()); t.addTags(null); assertObjectEquals("['foo','bar']", t.getTags()); assertInstanceOf(List.class, t.getTags()); }
/** * Test method for {@link Operation#addSchemes(java.util.Collection)}. */ @Test public void testAddSchemes() { Operation t = new Operation(); t.addSchemes(new ASet<String>().appendAll("foo")); assertObjectEquals("['foo']", t.getSchemes()); assertInstanceOf(List.class, t.getSchemes()); t.addSchemes(new ASet<String>()); assertObjectEquals("['foo']", t.getSchemes()); assertInstanceOf(List.class, t.getSchemes()); t.addSchemes(null); assertObjectEquals("['foo']", t.getSchemes()); assertInstanceOf(List.class, t.getSchemes()); }
/** * Test method for {@link Operation#addParameters(java.util.Collection)}. */ @Test public void testAddParameters() { Operation t = new Operation(); t.addParameters(new ASet<ParameterInfo>().appendAll(parameterInfo("foo","bar"))); assertObjectEquals("[{'in':'foo',name:'bar'}]", t.getParameters()); assertInstanceOf(List.class, t.getParameters()); t.addParameters(new ASet<ParameterInfo>()); assertObjectEquals("[{'in':'foo',name:'bar'}]", t.getParameters()); assertInstanceOf(List.class, t.getParameters()); t.addParameters(null); assertObjectEquals("[{'in':'foo',name:'bar'}]", t.getParameters()); assertInstanceOf(List.class, t.getParameters()); }