/**
 * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
 *
 * 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 io.gravitee.repository.management.model;

import java.util.Date;
import java.util.Objects;

/**
 * @author David BRASSELY (brasseld at gmail.com)
 */
public class ApiKey {

	/**
	 * Api Key
	 */
	private String key;

	/**
	 * Is the key revoked ?
	 */
	private boolean revoked;

	/**
	 * Token expiration date
	 */
	private Date expiration;

	/**
	 * The API key creation date
	 */
	private Date createdAt;

	/**
	 * The API key update date
	 */
	private Date updatedAt;

	/**
	 * The API for which the key is defined.
	 */
	private String api;

	/**
	 * The application for which the key is defined.
	 */
	private String application;

	public boolean isRevoked() {
		return revoked;
	}

	public void setRevoked(boolean revoked) {
		this.revoked = revoked;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public Date getExpiration() {
		return expiration;
	}

	public void setExpiration(Date expiration) {
		this.expiration = expiration;
	}

	public Date getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}

	public Date getUpdatedAt() {
		return updatedAt;
	}

	public void setUpdatedAt(Date updatedAt) {
		this.updatedAt = updatedAt;
	}

	public String getApi() {
		return api;
	}

	public void setApi(String api) {
		this.api = api;
	}

	public String getApplication() {
		return application;
	}

	public void setApplication(String application) {
		this.application = application;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		ApiKey apiKey = (ApiKey) o;
		return Objects.equals(key, apiKey.key);
	}

	@Override
	public int hashCode() {
		return Objects.hash(key);
	}
}
@@ -853,70 +853,8 @@
 y;%0A%0A
-%09/**%0A%09 * Is the key revoked ?%0A%09 */%0A%09private boolean revoked;%0A%0A
 %09/**
@@ -991,31 +991,117 @@
 %09 * 
-The API key update date
+Is the key revoked ?%0A%09 */%0A%09private boolean revoked;%0A%0A%09/**%0A%09 * If the key was revoked, the date of revocation.
 %0A%09 *
@@ -1116,23 +1116,22 @@
 te Date 
-updated
+revoke
 At;%0A%0A%09/*
@@ -1802,23 +1802,22 @@
 Date get
-Updated
+Revoke
 At() %7B%0A%09
@@ -1824,23 +1824,22 @@
 %09return 
-updated
+revoke
 At;%0A%09%7D%0A%0A
@@ -1858,23 +1858,22 @@
  set
-Updated
+Revoke
 At(Date 
 upda
@@ -1868,23 +1868,22 @@
 At(Date 
-updated
+revoke
 At) %7B%0A%09%09
@@ -1891,27 +1891,25 @@
 his.
-updatedAt = updated
+revokeAt = revoke
 At;%0A

Add revocation date