#include "util/TimeUnit.h"

TimeUnit::TimeUnit(int unit, uint64_t length, AgString description, int calendarField, bool secondary)
{
    this->unit = unit;
    this->length = length;
    this->description = description;
    this->calendarField = calendarField;
    this->secondary = secondary;
}

int TimeUnit::getUnit()
{
    return unit;
}

uint64_t TimeUnit::getLength()
{
    return length;
}

AgString TimeUnit::getDescription()
{
    return description;
}

int TimeUnit::getCalendarField()
{
    return calendarField;
}

bool TimeUnit::isSecondary()
{
    return secondary;
}

AgString TimeUnit::toString()
{
    return description;
}

int TimeUnit::hashCode()
{
    int const prime = int(31);
    int result = int(1);
    result = prime * result + unit;
    return result;
}

bool TimeUnit::equals(AgObjectPtr obj)
{
    UNUSED(obj);
    //todo
    assert(0);
    return false;
}




