Skip to content

Instantly share code, notes, and snippets.

View HyeonUkCho's full-sized avatar

HyeonUk HyeonUkCho

View GitHub Profile
@SneakyThrows
public void testSneakyThrows() {
throw new IllegalAccessException();
}
public void testSneakyThrows() {
try {
throw new IllegalAccessException();
} catch (java.lang.Throwable $ex) {
throw lombok.Lombok.sneakyThrow($ex);
private DateFormat format = new SimpleDateFormat("MM-dd-YYYY");
@Synchronized
public String synchronizedFormat(Date date) {
return format.format(date);
}
private final java.lang.Object $lock = new java.lang.Object[0];
private DateFormat format = new SimpleDateFormat("MM-dd-YYYY");
public void testCleanUp() {
try {
@Cleanup ByteArrayOutputStream baos = new ByteArrayOutputStream();
baos.write(new byte[] {'Y','e','s'});
System.out.println(baos.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
@Data(staticConstructor="of")
public class Company {
private final Person founder;
private String name;
private List<Person> employees;
}
public class Company {
private final Person founder;
@Getter @Setter @NonNull
private List<Person> members;
@NonNull
private List<Person> members;
public Family(@NonNull final List<Person> members) {
if (members == null) throw new java.lang.NullPointerException("members");
this.members = members;
@Getter @Setter private boolean employed = true;
@Setter(AccessLevel.PROTECTED) private String name;
private boolean employed = true;
private String name;
public boolean isEmployed() {
return employed;
}
@EqualsAndHashCode(callSuper=true,exclude={"address","city","state","zip"})
public class Person extends SentientBeing {
enum Gender { Male, Female }
@NonNull private String name;
@NonNull private Gender gender;
private String ssn;
private String address;
private String city;
@ToString(callSuper=true,exclude="someExcludeField")
public class Foo extends Bar {
private boolean someBoolean = true;
private String someStringField;
private float someExcludedField;
}
public class Foo extends Bar {