# PLEASE DO NOT EDIT THIS CODE
# This code was generated using the UMPLE @UMPLE_VERSION@ modeling language!
# NOTE: Ruby generator is experimental and is missing some features available in
# in other Umple generated languages like Java or PHP

module Example

class Student


  #------------------------
  # MEMBER VARIABLES
  #------------------------

  #Student Attributes - for documentation purposes
  #attr_reader :intId, :doubleId, :booleanId, :stringId

  #------------------------
  # CONSTRUCTOR
  #------------------------

  def initialize(a_doubleId, a_booleanId, a_stringId)
    @initialized = false
    @deleted = false
    @cachedHashCode = -1
    @intId = 0
    @can_set_intId = true
    @doubleId = a_doubleId
    @can_set_doubleId = false
    @booleanId = a_booleanId
    @can_set_booleanId = false
    @stringId = a_stringId
    @can_set_stringId = false
    @initialized = true
  end

  #------------------------
  # INTERFACE
  #------------------------

  def set_intId(a_intId)
    was_set = false
    return false unless @can_set_intId
    @can_set_intId = false
    @intId = a_intId
    was_set = true
    was_set
  end

  def get_intId
    @intId
  end

  def get_doubleId
    @doubleId
  end

  def get_booleanId
    @booleanId
  end

  def get_stringId
    @stringId
  end

  def is_booleanId?
    @booleanId
  end

  def eql?(obj)
    return false if obj.nil?
    return false unless self.class == obj.class

    compareTo = obj
    return false unless @intId == compareTo.instance_variable_get("@intId")

    return false unless @doubleId == compareTo.instance_variable_get("@doubleId")

    return false unless @booleanId == compareTo.instance_variable_get("@booleanId")

    return false if (@stringId.nil? and !compareTo.instance_variable_get("@stringId").nil?)
    return false if (!@stringId.nil? and !@stringId.eql?(compareTo.instance_variable_get("@stringId")))
    true
  end

  def hash
    return @cachedHashCode unless @cachedHashCode == -1
    @cachedHashCode = 17
    @cachedHashCode = @cachedHashCode * 23 + @intId

    @cachedHashCode = @cachedHashCode * 23 + @doubleId.hash

    @cachedHashCode = @cachedHashCode * 23 + (@booleanId ? 1 : 0)

    if (!@stringId.nil?)
      @cachedHashCode = @cachedHashCode * 23 + @stringId.hash
    else
      @cachedHashCode = @cachedHashCode * 23
    end
    @can_set_intId = false
    @can_set_doubleId = false
    @can_set_booleanId = false
    @can_set_stringId = false
    @cachedHashCode
  end

  def delete
    @deleted = true
  end

end
end
