/* * Copyright (c) 2010-2013 Evolveum * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.evolveum.icf.dummy.resource; import java.util.Map; /** * @author semancik * */ public class ScriptHistoryEntry { private String language; private String code; private Map<String,Object> params; private long timestamp; public ScriptHistoryEntry(String language, String code, Map<String, Object> params) { super(); this.language = language; this.code = code; this.params = params; timestamp = System.currentTimeMillis(); } public String getLanguage() { return language; } public void setLanguage(String language) { this.language = language; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public Map<String, Object> getParams() { return params; } public void setParams(Map<String, Object> params) { this.params = params; } public long getTimestamp() { return timestamp; } public void setTimestamp(long timestamp) { this.timestamp = timestamp; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((code == null) ? 0 : code.hashCode()); result = prime * result + ((language == null) ? 0 : language.hashCode()); result = prime * result + ((params == null) ? 0 : params.hashCode()); result = prime * result + (int) (timestamp ^ (timestamp >>> 32)); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ScriptHistoryEntry other = (ScriptHistoryEntry) obj; if (code == null) { if (other.code != null) return false; } else if (!code.equals(other.code)) return false; if (language == null) { if (other.language != null) return false; } else if (!language.equals(other.language)) return false; if (params == null) { if (other.params != null) return false; } else if (!params.equals(other.params)) return false; if (timestamp != other.timestamp) return false; return true; } @Override public String toString() { return "ScriptHistoryEntry(language=" + language + ", code=" + code + ", params=" + params + ", timestamp=" + timestamp + ")"; } }