Fish & Chips Club 4.10.0.0

hirondelle.fish.main.rating
Class Rating

Object
  extended by hirondelle.fish.main.rating.Rating

public final class Rating
extends Object

Rating of a particular Resto.

Ratings are a kind of "addendum" to Resto. When a Resto is created, its various ratings are created with initial value 0. The user may then later edit the Ratings and change them to more appropriate values.


Constructor Summary
Rating(Id aId, SafeText aName, Integer aFishRating, Integer aChipsRating, Integer aPriceRating, Integer aLocationRating, Integer aServiceRating, Integer aBeerRating, BigDecimal aOverallRating)
          Constructor.
 
Method Summary
 boolean equals(Object aThat)
           
 Integer getBeerRating()
          Return the beer rating passed to the constructor.
 Integer getChipsRating()
          Return the chips rating passed to the constructor.
 Integer getFishRating()
          Return the fish rating passed to the constructor.
 Id getId()
          Return the Id passed to the constructor.
 Integer getLocationRating()
          Return the location rating passed to the constructor.
 BigDecimal getOverallRating()
          Return the overall rating passed to the constructor.
 Integer getPriceRating()
          Return the price rating passed to the constructor.
 SafeText getRestaurant()
          Return the name of the restaurant passed to the constructor.
 Integer getServiceRating()
          Return the service rating passed to the constructor.
 int hashCode()
           
 String toString()
          Intended for debugging only.
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rating

public Rating(Id aId,
              SafeText aName,
              Integer aFishRating,
              Integer aChipsRating,
              Integer aPriceRating,
              Integer aLocationRating,
              Integer aServiceRating,
              Integer aBeerRating,
              BigDecimal aOverallRating)
       throws ModelCtorException
Constructor.

The overall rating is a calculated field. In this implementation, the calculation is actually done not in this class, but rather in SQL. This causes some minor repetition, but allows a simple means to alter the calculation, if needed, without needing a redeploy.

Parameters:
aId - restaurant id (required), 1..50 characters
aName - name of the restaurant (optional), 2..50 characters
aFishRating - (required) 0..10
aChipsRating - (required) 0..10
aPriceRating - (required) 0..10
aLocationRating - (required) 0..10
aServiceRating - (required) 0..10
aBeerRating - (required) 0..10
aOverallRating - (optional) 0.00..10.00
Throws:
ModelCtorException
Method Detail

getId

public Id getId()
Return the Id passed to the constructor.


getRestaurant

public SafeText getRestaurant()
Return the name of the restaurant passed to the constructor.


getFishRating

public Integer getFishRating()
Return the fish rating passed to the constructor.


getChipsRating

public Integer getChipsRating()
Return the chips rating passed to the constructor.


getPriceRating

public Integer getPriceRating()
Return the price rating passed to the constructor.


getLocationRating

public Integer getLocationRating()
Return the location rating passed to the constructor.


getServiceRating

public Integer getServiceRating()
Return the service rating passed to the constructor.


getBeerRating

public Integer getBeerRating()
Return the beer rating passed to the constructor.


getOverallRating

public BigDecimal getOverallRating()
Return the overall rating passed to the constructor.


toString

public String toString()
Intended for debugging only.

Overrides:
toString in class Object

equals

public boolean equals(Object aThat)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

Fish & Chips Club 4.10.0.0

Copyright Hirondelle Systems - Generated 2013Oct19.12.26