Skip to content

Commit 14393b7

Browse files
committed
Remove Travis CI
1 parent 3748b00 commit 14393b7

File tree

2 files changed

+36
-44
lines changed

2 files changed

+36
-44
lines changed

.travis.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

README.md

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# Model Citizen
22

3-
[![Build Status](https://travis-ci.org/mguymon/model-citizen.png?branch=master)](https://travis-ci.org/mguymon/model-citizen)
4-
53
Model Citizen is an annotation based model factory for Java, inspired by [FactoryGirl](https://github.com/thoughtbot/factory_girl)
64

7-
A Model is mapped by a _@Blueprint_ using annotated fields. Blueprints contain
8-
default values and references to other @Blueprinted models. The _ModelFactory_ can
5+
A Model is mapped by a _@Blueprint_ using annotated fields. Blueprints contain
6+
default values and references to other @Blueprinted models. The _ModelFactory_ can
97
create models based on registered blueprints. A model already created can be
108
passed into the _ModelFactory_ as a reference model, which will be used as the basis
11-
for the new Model.
9+
for the new Model.
1210

1311

1412
<https://github.com/mguymon/model-citizen>
@@ -24,7 +22,7 @@ for the new Model.
2422
<version>0.8.2</version>
2523
</dependency>
2624

27-
## Blueprint
25+
## Blueprint
2826

2927
A blueprint is a Class annotated with _@Blueprint( Class )_ and contains annotated fields. Everything else is ignored by the _ModelFactory_.
3028
Model Citizen [own blueprints](https://github.com/mguymon/model-citizen/tree/master/core/src/test/java/com/tobedevoured/modelcitizen/blueprint) are a great example of how they work.
@@ -39,22 +37,22 @@ Model Citizen [own blueprints](https://github.com/mguymon/model-citizen/tree/mas
3937
* _force_: [boolean] Force the value of the Default to always be set, even if the target field already has a value. Default is false. This is useful for overriding primatives or Collections.
4038

4139
**@Mapped**: The value is mapped to another @Blueprint, default is the blueprint for
42-
matching field's Class. Mapped class can be set by the _target_ param.
40+
matching field's Class. Mapped class can be set by the _target_ param.
4341

4442
**@MappedList**: Creates a List of Models mapped to another blueprint.
4543
* _size_: [int] Number of Models to be created by the ModelFactory and added to List, defaults to 1.
4644
* _target_: [Class] The target Blueprint Class used to create Models
4745
* _targetList_: [Class] The List created, defaults to ArrayList
4846
* _ignoreEmpty_: [boolean] If true, do not create Models for an empty Set. Defaults to true.
4947
* _force_: [boolean] Force the value of the MappedList to always be set, even if the target field already has a value. Default is false.
50-
48+
5149
**@MappedSet**: Creates a Set of Models mapped to another blueprint.
5250
* _size_: [int] Number of Models to be created by the ModelFactory and added to Set, defaults to 1.
5351
* _target_: [Class] The target Blueprint Class used to create Models
5452
* _targetSet_: [Class] The Set created, defaults to HashSet
5553
* _ignoreEmpty_: [boolean] If true, do not create Models for an empty Set. Defaults to true.
5654
* _force_: [boolean] Force the value of the MappedSet to always be set, even if the target field already has a value. Default is false.
57-
55+
5856
**@Nullable**: Specifies this field can be null and not to set a value by the ModelFactory.
5957

6058
### Callbacks
@@ -73,46 +71,46 @@ A Blueprint will inherit the fields of its parent, except for `ConstructorCallba
7371

7472
## Model
7573

76-
Presently only supports [template for JavaBean Models](https://github.com/mguymon/model-citizen/blob/master/core/src/main/java/com/tobedevoured/modelcitizen/template/JavaBeanTemplate.java).
74+
Presently only supports [template for JavaBean Models](https://github.com/mguymon/model-citizen/blob/master/core/src/main/java/com/tobedevoured/modelcitizen/template/JavaBeanTemplate.java).
7775
For annotations to work with the template, the model must follow the [JavaBean](http://en.wikibooks.org/wiki/Java_Programming/Java_Beans) getter and setters
7876
for fields.
7977

8078
### Working with primitives
8179

82-
[Primitive fields are intialized as zero](http://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.12.5) and
83-
will never be null. This will cause the _ModelFactory_ to think that a value has already been assigned to the model and
80+
[Primitive fields are intialized as zero](http://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.12.5) and
81+
will never be null. This will cause the _ModelFactory_ to think that a value has already been assigned to the model and
8482
not assign one from the blueprint. To work around this, use the `force=true` in the blueprint to force that value is always assigned from the blueprint, for example:
8583

8684
@Blueprint(Car.class)
8785
public class CarBlueprint {
88-
86+
8987
@Default(force=true)
9088
float mileage = 100.1f;
9189

9290
## ModelFactory
9391

94-
Creates new instances of Models based on registered Blueprints. It is possible to
92+
Creates new instances of Models based on registered Blueprints. It is possible to
9593
[register Blueprints by package](https://github.com/mguymon/model-citizen/wiki/Register-By-Package).
9694

97-
A new instance is always constructed, unless specified by a
95+
A new instance is always constructed, unless specified by a
9896
[Policy](https://github.com/mguymon/model-citizen/wiki/Policy).
9997

10098
Example of creating a new _ModelFactory_ and registering the _CarBlueprint_
10199

102100
ModelFactory modelFactory = new ModelFactory();
103101
modelFactory.registerBlueprint( CarBlueprint.class );
104-
102+
105103
A Model with a registered Blueprint can then be created by Class:
106104

107105
modelFactory.createModel(Car.class);
108-
109-
or by passing a Model directly with override values:
106+
107+
or by passing a Model directly with override values:
110108

111109
Car car = new Car();
112110
car.setMake( "Truck" );
113-
111+
114112
# create a new Model using blueprint defaults, but overriding the Make to be Truck.
115-
car = modelFactory.createModel(car);
113+
car = modelFactory.createModel(car);
116114

117115
## A Simple Example
118116

@@ -132,56 +130,56 @@ or by passing a Model directly with override values:
132130

133131
@Blueprint(Car.class)
134132
public class CarBlueprint {
135-
133+
136134
@Default
137135
String make = "car make";
138-
136+
139137
@Default
140138
String manufacturer = "car manufacturer";
141-
139+
142140
@Default
143141
Integer mileage = 100;
144-
142+
145143
@Default
146144
Map status = new HashMap();
147145
}
148-
146+
149147
### The Car Model
150148

151149
public class Car {
152150
private String make;
153151
private String manufacturer;
154152
private Integer mileage;
155153
private Map status;
156-
154+
157155
public String getMake() {
158156
return make;
159157
}
160-
158+
161159
public void setMake(String make) {
162160
this.make = make;
163161
}
164-
162+
165163
public String getManufacturer() {
166164
return manufacturer;
167165
}
168-
166+
169167
public void setManufacturer(String manufacturer) {
170168
this.manufacturer = manufacturer;
171169
}
172-
170+
173171
public Integer getMileage() {
174172
return mileage;
175173
}
176-
174+
177175
public void setMileage(Integer mileage) {
178176
this.milage = mileage;
179177
}
180-
178+
181179
public Map getStatus() {
182180
return status;
183181
}
184-
182+
185183
public void setStatus(Map status) {
186184
this.status = status;
187185
}
@@ -200,7 +198,7 @@ There is an optional jar that provides additional support for Spring:
200198
<artifactId>spring</artifactId>
201199
<version>0.8.1</version>
202200
</dependency>
203-
201+
204202
### Avoiding Spring jar collisions
205203

206204
ModelFactory should work with Spring 3.x, so you can easily exclude ModelFactory's Spring depedency and use the existing one in your pom.
@@ -216,7 +214,7 @@ ModelFactory should work with Spring 3.x, so you can easily exclude ModelFactory
216214
</exclusion>
217215
</exclusions>
218216
</dependency>
219-
217+
220218
### What does this give me?
221219

222220
This provides a new class [ModelFactoryBean](https://github.com/mguymon/model-citizen/blob/master/spring/src/main/java/com/tobedevoured/modelcitizen/spring/ModelFactoryBean.java) and annotation [@SpringBlueprint](https://github.com/mguymon/model-citizen/blob/master/spring/src/main/java/com/tobedevoured/modelcitizen/spring/annotation/SpringBlueprint.java). When the ModelFactoryBean is registered with Spring, it allows the `@SpringBlueprint` and models created by the ModelFactoryBean to be injected by Spring.
@@ -235,12 +233,12 @@ This provides a new class [ModelFactoryBean](https://github.com/mguymon/model-ci
235233

236234
@Autowired
237235
SportsCarRepository sportsCarRepository;
238-
236+
239237
@Default
240238
Integer topSpeed = 100;
241239
}
242-
243-
240+
241+
244242
## License
245243

246244
Licensed to the Apache Software Foundation (ASF) under one or more

0 commit comments

Comments
 (0)