跳至主要內容

Spring Batch主要类之间的关系


Spring Batch主要类之间的关系

类关系图

Spring Batch

相关类源码

package org.springframework.batch.core;

import java.io.Serializable;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;

public class JobParameters implements Serializable {
    private final Map<String, JobParameter> parameters;

    public JobParameters() {
        this.parameters = new LinkedHashMap();
    }

    public JobParameters(Map<String, JobParameter> parameters) {
        this.parameters = new LinkedHashMap(parameters);
    }

    public Long getLong(String key) {
        if (!this.parameters.containsKey(key)) {
            return 0L;
        } else {
            Object value = ((JobParameter)this.parameters.get(key)).getValue();
            return value == null ? 0L : (Long)value;
        }
    }

    public Long getLong(String key, long defaultValue) {
        return this.parameters.containsKey(key) ? this.getLong(key) : defaultValue;
    }

    public String getString(String key) {
        JobParameter value = (JobParameter)this.parameters.get(key);
        return value == null ? null : value.toString();
    }

    public String getString(String key, String defaultValue) {
        return this.parameters.containsKey(key) ? this.getString(key) : defaultValue;
    }

    public Double getDouble(String key) {
        if (!this.parameters.containsKey(key)) {
            return 0.0;
        } else {
            Double value = (Double)((JobParameter)this.parameters.get(key)).getValue();
            return value == null ? 0.0 : value;
        }
    }

    public Double getDouble(String key, double defaultValue) {
        return this.parameters.containsKey(key) ? this.getDouble(key) : defaultValue;
    }

    public Date getDate(String key) {
        return this.getDate(key, (Date)null);
    }

    public Date getDate(String key, Date defaultValue) {
        return this.parameters.containsKey(key) ? (Date)((JobParameter)this.parameters.get(key)).getValue() : defaultValue;
    }

    public Map<String, JobParameter> getParameters() {
        return new LinkedHashMap(this.parameters);
    }

    public boolean isEmpty() {
        return this.parameters.isEmpty();
    }

    public boolean equals(Object obj) {
        if (!(obj instanceof JobParameters)) {
            return false;
        } else if (obj == this) {
            return true;
        } else {
            JobParameters rhs = (JobParameters)obj;
            return this.parameters.equals(rhs.parameters);
        }
    }

    public int hashCode() {
        return 17 + 23 * this.parameters.hashCode();
    }

    public String toString() {
        return this.parameters.toString();
    }
}

上次编辑于:
贡献者: Neil