Skip to content

Instantly share code, notes, and snippets.

@fge

fge/StudentBuilder.java

Last active Aug 29, 2015
Embed
What would you like to do?
package com.github.parboiled1.grappa.samples;
import com.github.parboiled1.grappa.helpers.ValueBuilder;
import com.google.common.eventbus.Subscribe;
import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
@ParametersAreNonnullByDefault
public final class StudentBuilder
implements ValueBuilder<Student>
{
private String name;
private String number;
public boolean setName(final String name)
{
this.name = name;
return true;
}
public boolean setNumber(final String number)
{
this.number = number;
return true;
}
@Nonnull
@Override
public Student build()
{
return new Student(name, number);
}
@Override
public boolean reset()
{
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment