public class RatingBuilder extends AbstractBeanEntityBuilder implements org.apache.commons.lang3.builder.Builder<Rating>
Build a Rating
.
AbstractBeanEntityBuilder.AttrMethod, AbstractBeanEntityBuilder.DoubleAttrMethod, AbstractBeanEntityBuilder.LongAttrMethod
id, idSet, type
Constructor and Description |
---|
RatingBuilder()
Create an uninitialized rating builder.
|
RatingBuilder(EntityType type)
Create an unitialized rating builder.
|
Modifier and Type | Method and Description |
---|---|
Rating |
build()
Build the entity.
|
RatingBuilder |
clearItemId()
Clear the item ID.
|
RatingBuilder |
clearRating()
Clear the rating value.
|
RatingBuilder |
clearTimestamp() |
RatingBuilder |
clearUserId()
Clear the user ID.
|
static RatingBuilder |
copy(Rating r)
Construct a new rating builder that is a copy of a particular rating.
|
long |
getId()
Get the rating ID.
|
long |
getItemId()
Get the item ID.
|
double |
getRating()
Get the rating.
|
long |
getTimestamp()
Get the timestamp.
|
long |
getUserId()
Get the user ID.
|
RatingBuilder |
reset()
Reset this entity builder, clearing all properties except the entity type.
|
RatingBuilder |
setId(long id)
Set the rating ID.
|
RatingBuilder |
setItemId(long iid)
Set the item ID.
|
RatingBuilder |
setRating(double r)
Set the rating value.
|
RatingBuilder |
setTimestamp(long ts)
Set the timestamp.
|
RatingBuilder |
setUserId(long uid)
Set the user ID.
|
clearAttribute, clearExtraAttribute, setAttribute, setExtraAttribute, setLongAttribute
setAttribute, setDoubleAttribute
public RatingBuilder()
Create an uninitialized rating builder.
public RatingBuilder(EntityType type)
Create an unitialized rating builder.
type
- The rating builder.public static RatingBuilder copy(Rating r)
Construct a new rating builder that is a copy of a particular rating.
r
- The rating to copy.public RatingBuilder reset()
EntityBuilder
Reset this entity builder, clearing all properties except the entity type.
reset
in class EntityBuilder
public long getId()
Get the rating ID.
@EntityAttributeSetter(value="id") public RatingBuilder setId(long id)
Set the rating ID.
setId
in class EntityBuilder
id
- The rating ID.public long getUserId()
Get the user ID.
@EntityAttributeSetter(value="user") public RatingBuilder setUserId(long uid)
Set the user ID.
uid
- The user ID.public long getItemId()
Get the item ID.
@EntityAttributeSetter(value="item") public RatingBuilder setItemId(long iid)
Set the item ID.
iid
- The item ID.@EntityAttributeClearer(value="item") public RatingBuilder clearItemId()
Clear the item ID.
@EntityAttributeClearer(value="user") public RatingBuilder clearUserId()
Clear the user ID.
public double getRating()
Get the rating.
@EntityAttributeSetter(value="rating") public RatingBuilder setRating(double r)
Set the rating value.
r
- The rating value.@EntityAttributeClearer(value="rating") public RatingBuilder clearRating()
Clear the rating value.
public long getTimestamp()
Get the timestamp.
@EntityAttributeSetter(value="timestamp") public RatingBuilder setTimestamp(long ts)
Set the timestamp.
ts
- The timestamp.@EntityAttributeClearer(value="timestamp") public RatingBuilder clearTimestamp()
public Rating build()
EntityBuilder
Build the entity.
build
in interface org.apache.commons.lang3.builder.Builder<Rating>
build
in class AbstractBeanEntityBuilder