public class RatingBuilder extends Object implements EventBuilder<Rating>, org.apache.commons.lang3.builder.Builder<Rating>
Rating
.Constructor and Description |
---|
RatingBuilder()
Create an uninitialized rating builder.
|
Modifier and Type | Method and Description |
---|---|
Rating |
build()
Builds the event.
|
RatingBuilder |
clearRating()
Clear the rating value (so this builder builds unrate events).
|
static RatingBuilder |
copy(Rating r)
Construct a new rating builder that is a copy of a particular rating.
|
long |
getItemId()
Get the item ID.
|
double |
getRating()
Get the rating.
|
long |
getTimestamp()
Get the timestamp.
|
long |
getUserId()
Get the user ID.
|
boolean |
hasRating()
Query whether this builder has a rating.
|
void |
reset()
Clear the rating builder, as if it were freshly instantiated..
|
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.
|
public static RatingBuilder copy(Rating r)
r
- The rating to copy.public void reset()
EventBuilder
reset
in interface EventBuilder<Rating>
public long getUserId()
public RatingBuilder setUserId(long uid)
setUserId
in interface EventBuilder<Rating>
uid
- The user ID.public long getItemId()
public RatingBuilder setItemId(long iid)
setItemId
in interface EventBuilder<Rating>
iid
- The item ID.public double getRating()
public RatingBuilder setRating(double r)
r
- The rating value.public RatingBuilder clearRating()
public boolean hasRating()
true
if the builder has a rating, false
if it will produce unrate
events.public long getTimestamp()
public RatingBuilder setTimestamp(long ts)
setTimestamp
in interface EventBuilder<Rating>
ts
- The timestamp.public Rating build()
EventBuilder
build
in interface org.apache.commons.lang3.builder.Builder<Rating>
build
in interface EventBuilder<Rating>