All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jelastic.api.utils.DateRange Maven / Gradle / Ivy

There is a newer version: 8.12-1
Show newest version
/*Server class MD5: 641d46850a7d2342ca1cfa49bad559cd*/
package com.jelastic.api.utils;

import com.jelastic.api.core.utils.DateUtils;
import java.util.Date;

/**
 * @name Jelastic API Client
 * @version 8.11.2
 * @copyright Jelastic, Inc.
 */
public class DateRange {

    public Date start;

    public Date end;

    public DateRange() {
    }

    public DateRange(Date start, Date end) {
        this.start = start;
        this.end = end;
    }

    @Override
    public String toString() {
        return "from " + DateUtils.formatSqlDateTime(start) + " to " + DateUtils.formatSqlDateTime(end);
    }

    protected String toIsoDateString(Date date) {
        if (date == null) {
            return "null";
        }
        return DateUtils.formatIsoTz(date);
    }

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof DateRange)) {
            return false;
        }
        DateRange other = (DateRange) o;
        return (start == null && other.start == null || start.equals(other.start)) && (end == null && other.end == null || end.equals(other.end));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy