@Override
  public Person getNew(boolean withLink) {
    Person.Builder builder = Person.builder().from(RESPONSIBLE_FACTORY.getNew(withLink));

    if (withLink) {
      builder.addRole(ROLE_FACTORY.getNew(false));
    }

    return builder.build();
  }
Пример #2
0
  public static void main(String[] args) {
    Person person = new Person.Builder().age(18).name("Ivan").build();
    Person.Builder builder = new Person.Builder();
    builder.age(20).name("Petro");
    Person person2 = builder.build();
    Person.Pet pet = person.new Pet("Barsik");
    Person.Pet pet2 = person2.new Pet("Barsik");
    System.out.println(pet.equals(pet2));

    Comparator<Person> ascComparator =
        new Comparator<Person>() {
          {
            System.out.println("Hello");
          }

          @Override
          public int compare(Person o1, Person o2) {
            return o1.getName().compareTo(o2.getName());
          }
        };
  }
Пример #3
0
 /** A person or organization attending the event. */
 @NotNull
 public Builder attendee(@NotNull Person.Builder person) {
   putValue("attendee", person.build());
   return this;
 }
Пример #4
0
 /** An organizer of an Event. */
 @NotNull
 public Builder organizer(@NotNull Person.Builder person) {
   putValue("organizer", person.build());
   return this;
 }
Пример #5
0
 /**
  * A performer at the event&#x2014;for example, a presenter, musician, musical group or actor.
  */
 @NotNull
 public Builder performer(@NotNull Person.Builder person) {
   putValue("performer", person.build());
   return this;
 }
Пример #6
0
 /** Alumni of educational organization. */
 @NotNull
 public Builder alumni(@NotNull Person.Builder person) {
   putValue("alumni", person.build());
   return this;
 }
Пример #7
0
 /** Someone working for this organization. */
 @NotNull
 public Builder employee(@NotNull Person.Builder person) {
   putValue("employee", person.build());
   return this;
 }
Пример #8
0
 /**
  * The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a
  * book.
  */
 @NotNull
 public Builder agent(@NotNull Person.Builder person) {
   putValue("agent", person.build());
   return this;
 }
Пример #9
0
 /**
  * Organization or person who adapts a creative work to different languages, regional
  * differences and technical requirements of a target market.
  */
 @NotNull
 public Builder translator(@NotNull Person.Builder person) {
   putValue("translator", person.build());
   return this;
 }
Пример #10
0
 /** Fictional person connected with a creative work. */
 @NotNull
 public Builder character(@NotNull Person.Builder person) {
   putValue("character", person.build());
   return this;
 }
Пример #11
0
 /** Specifies the Person who edited the CreativeWork. */
 @NotNull
 public Builder editor(@NotNull Person.Builder person) {
   putValue("editor", person.build());
   return this;
 }
Пример #12
0
 /** The party holding the legal copyright to the CreativeWork. */
 @NotNull
 public Builder copyrightHolder(@NotNull Person.Builder person) {
   putValue("copyrightHolder", person.build());
   return this;
 }
Пример #13
0
 /** A secondary contributor to the CreativeWork. */
 @NotNull
 public Builder contributor(@NotNull Person.Builder person) {
   putValue("contributor", person.build());
   return this;
 }
Пример #14
0
 /** Specifies the Person that is legally accountable for the CreativeWork. */
 @NotNull
 public Builder accountablePerson(@NotNull Person.Builder person) {
   putValue("accountablePerson", person.build());
   return this;
 }