Advertisement
Venciity

Example output

Nov 13th, 2014
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var Estate = (function () {
  2.     function Estate(name, area, location, isFurnitured) {
  3.         this.setName(name);
  4.         this.setArea(area);
  5.         this.setLocation(location);
  6.         this.setIsFurnitured(isFurnitured);
  7.     }
  8.  
  9.     Estate.prototype.getName = function() {
  10.         return this._name;
  11.     };
  12.  
  13.     Estate.prototype.setName = function(name) {
  14.         Object.prototype.validateIsNullOrEmpty(name);
  15.         this._name = name;
  16.     };
  17.  
  18.     Estate.prototype.getArea = function() {
  19.         return this._area;
  20.     };
  21.  
  22.     Estate.prototype.setArea = function(area) {
  23.         Object.prototype.validateIsNumber(area);
  24.         this._area = area;
  25.     };
  26.  
  27.     Estate.prototype.getLocation = function() {
  28.         return this._location;
  29.     };
  30.  
  31.     Estate.prototype.setLocation = function(location) {
  32.         Object.prototype.validateIsNullOrEmpty(location);
  33.         this._location = location;
  34.     };
  35.  
  36.     Estate.prototype.getIsFurnitured = function() {
  37.         return this._isFurnitured;
  38.     };
  39.  
  40.     Estate.prototype.setIsFurnitured = function(isFurnitured) {
  41.         Object.prototype.validateIsBoolean(isFurnitured);
  42.         this._isFurnitured = isFurnitured;
  43.     };
  44.  
  45.  
  46.     Estate.prototype.toString = function () {
  47.         return 'Name: ' + this.getName() + 'Area: ' + this.getArea() + 'Location: ' + this.getLocation() + 'IsFurnitured: ' + this.getIsFurnitured();
  48.     };
  49.  
  50.     return Estate;
  51. }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement