This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.fest.assertions.Assertions.assertThat; | |
@Test | |
public void booleanAssertions() { | |
assertThat(true).isTrue(); | |
assertThat(false).isFalse(); | |
} | |
@Test | |
public void objectsAssertions() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Getter(AccessLevel.PROTECTED) | |
private int b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setObject(Integer number) { | |
this.number = checkNotNull(number); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.inject.Inject; | |
@Inject | |
private DataSource dataSource; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Size.List({ | |
@Size(min = COUNTRY_MIN_LENGTH, message = "{value.too-short}"), | |
@Size(max = COUNTRY_MAX_LENGTH, message = "{value.too-long}") | |
}) | |
private String country; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Language { | |
private int id; | |
private String name; | |
private String locale; | |
public Language(final int id, final String name, final String locale) { | |
this.id = id; | |
this.name = name; | |
this.locale = locale; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static Function<Entity, Integer> INVOKE_GET_ID = | |
new Function<Entity, Integer>() { | |
@Override | |
public Integer apply(final Entity entity) { | |
return entity.getId(); | |
} | |
}; | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Date; | |
import javax.persistence.Column; | |
import javax.persistence.Entity; | |
import javax.persistence.EntityListeners; | |
import javax.persistence.GeneratedValue; | |
import javax.persistence.Id; | |
import javax.persistence.Table; | |
import javax.persistence.Temporal; | |
import javax.persistence.TemporalType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ru.mystamps.web.validation.jsr303; | |
import java.lang.annotation.Documented; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.Target; | |
import javax.validation.Constraint; | |
import javax.validation.Payload; | |
import javax.validation.ReportAsSingleViolation; | |
import javax.validation.constraints.Pattern; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity | |
@Table(name = "countries") | |
@Getter | |
@Setter | |
public class Country { | |
public static final int NAME_LENGTH = 50; | |
@Id | |
@GeneratedValue |
OlderNewer