Examples of Person


Examples of net.petrikainulainen.spring.datajpa.model.Person

    @RequestMapping(value = "/person/delete/{id}", method = RequestMethod.GET)
    public String delete(@PathVariable("id") Long id, RedirectAttributes attributes) {
        LOGGER.debug("Deleting person with id: " + id);

        try {
            Person deleted = personService.delete(id);
            addFeedbackMessage(attributes, FEEDBACK_MESSAGE_KEY_PERSON_DELETED, deleted.getName());
        } catch (PersonNotFoundException e) {
            LOGGER.debug("No person found with id: " + id);
            addErrorMessage(attributes, ERROR_MESSAGE_KEY_DELETED_PERSON_WAS_NOT_FOUND);
        }
View Full Code Here

Examples of net.sf.laja.example.person.behaviour.Person

     *     in PersonStateTemplate describes how each BMI attribute is mapped to an attribute in "Person state".
     *  - How to work with composition. In this case we gather all BMI calculations in the behaviour class BodyMassIndex
     *    and then we let 'Person' delegate to this object in the method calculateBmi().
     */
    public static void main(String... args) {
        Person person = Person.givenName("Joakim").surname("Tengstrand").weightInKilograms(82).height(Height.heightInCentimeters(186)).asPerson();
        System.out.println(person);
        System.out.println("Body Mass Index: " + person.calculateBmi());
        System.out.println("Has normal weight?: " + person.hasNormalWeight());
    }
View Full Code Here

Examples of net.sf.wicketdemo.domain.Person

        });

        final Button button = new Button("addAuthor") {
      @Override
      public void onSubmit() {
        ((List<Person>) authorsModel.getObject()).add(new Person());
      }
    };
        form.add(button);
        add(form);
View Full Code Here

Examples of net.sourceforge.stripes.examples.bugzooky.biz.Person

    /** The URL the user was trying to access (null if the login page was accessed directly). */
    public void setTargetUrl(String targetUrl) { this.targetUrl = targetUrl; }
   
    public Resolution login() {
        PersonManager pm = new PersonManager();
        Person person = pm.getPerson(this.username);

        if (person == null) {
            ValidationError error = new LocalizableError("usernameDoesNotExist");
            getContext().getValidationErrors().add("username", error);
            return getContext().getSourcePageResolution();
        }
        else if (!person.getPassword().equals(password)) {
            ValidationError error = new LocalizableError("incorrectPassword");
            getContext().getValidationErrors().add("password", error);
            return getContext().getSourcePageResolution();
        }
        else {
View Full Code Here

Examples of net.usefulbits.model.Person

    @Test
    public void testSave() {
        createAndSavePerson("David", 28);
        assertEquals(1, countRowsInTable("person"));

        Person david = getSinglePerson();
        assertEquals("Name not saved correctly", "David", david.getName());
        assertEquals("Age not saved correctly", 28, david.getAge());
    }
View Full Code Here

Examples of objectstructures.Person

@SuppressWarnings("all")
public class PersonTest extends TestCase {
  private Person hallvard;
 
  private Person _init_hallvard() {
    Person _person = new Person("Hallvard", 'M');
    return _person;
  }
View Full Code Here

Examples of org.adoptopenjdk.lambda.tutorial.exercise2.Person

     * @see Person#getAge()
     */
    @Test
    public void getAllPersonsEligibleToVote() {
        List<Person> potentialVoters =
                new ArrayList<>(asList(new Person("Tom", 24), new Person("Dick", 75), new Person("Harry", 17)));

        int legalAgeOfVoting = 18;
        List<Person> eligibleVoters = VotingRules.eligibleVoters(potentialVoters, legalAgeOfVoting);

        assertThat(eligibleVoters, hasSize(2));
View Full Code Here

Examples of org.andromda.timetracker.domain.Person

     * @see org.andromda.timetracker.service.PeopleService#createPerson(org.andromda.timetracker.vo.PersonVO)
     */
    protected java.lang.Long handleCreatePerson(org.andromda.timetracker.vo.PersonVO personVO)
        throws java.lang.Exception
    {
        Person person = Person.Factory.newInstance();
        getPersonDao().personVOToEntity(personVO, person, true);
        getPersonDao().create(person);
        return person.getId();
    }
View Full Code Here

Examples of org.apache.abdera.model.Person

    AtomDate dt = dte.getValue();
    assertNotNull(dt);
    Calendar c = dt.getCalendar();
    AtomDate cdt = new AtomDate(c);
    assertEquals(dt.getTime(), cdt.getTime());
    Person person = feed.getAuthor();
    assertNotNull(person);
    assertEquals(person.getName(), "John Doe");
    assertNull(person.getEmail());
    assertNull(person.getUri());
    IRIElement id = feed.getIdElement();
    assertNotNull(id);
    assertEquals(id.getValue(), new IRI("urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6"));
    List<Entry> entries = feed.getEntries();
    assertEquals(entries.size(), 1);
View Full Code Here

Examples of org.apache.avro.ipc.specific.Person

    Assert.assertFalse(builder.hasFriends());
    Assert.assertNull(builder.getFriends());
    Assert.assertFalse(builder.hasLanguages());
    Assert.assertNull(builder.getLanguages());
   
    Person person = builder.build();
    Assert.assertEquals("James Gosling", person.getName().toString());
    Assert.assertEquals(new Integer(1955), person.getYearOfBirth());
    Assert.assertEquals("US", person.getCountry().toString())// country should default to "US"
    Assert.assertEquals("CA", person.getState().toString());
    Assert.assertNotNull(person.getFriends())// friends should default to an empty list
    Assert.assertEquals(0, person.getFriends().size());
    Assert.assertNotNull(person.getLanguages()); // Languages should now be "English" and "Java"
    Assert.assertEquals(2, person.getLanguages().size());
    Assert.assertEquals("English", person.getLanguages().get(0).toString());
    Assert.assertEquals("Java", person.getLanguages().get(1).toString());
   
    // Test copy constructors:
    Assert.assertEquals(builder, Person.newBuilder(builder));
    Assert.assertEquals(person, Person.newBuilder(person).build());
   
    Person.Builder builderCopy = Person.newBuilder(person);
    Assert.assertEquals("James Gosling", builderCopy.getName().toString());
    Assert.assertEquals(new Integer(1955), builderCopy.getYearOfBirth());
    Assert.assertEquals("US", builderCopy.getCountry().toString())// country should default to "US"
    Assert.assertEquals("CA", builderCopy.getState().toString());
    Assert.assertNotNull(builderCopy.getFriends())// friends should default to an empty list
    Assert.assertEquals(0, builderCopy.getFriends().size());
   
    // Test clearing fields:
    builderCopy.clearFriends().clearCountry();
    Assert.assertFalse(builderCopy.hasFriends());
    Assert.assertFalse(builderCopy.hasCountry());
    Assert.assertNull(builderCopy.getFriends());
    Assert.assertNull(builderCopy.getCountry());
    Person person2 = builderCopy.build();
    Assert.assertNotNull(person2.getFriends());
    Assert.assertTrue(person2.getFriends().isEmpty());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.