com.virgilsecurity.keyknox.model.CloudEntry.kt Maven / Gradle / Ivy
/*
* Copyright (c) 2015-2019, Virgil Security, Inc.
*
* Lead Maintainer: Virgil Security Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* (1) Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* (2) Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* (3) Neither the name of virgil nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.virgilsecurity.keyknox.model
import com.google.gson.annotations.SerializedName
import java.util.*
/**
* Class representing entry in cloud.
*/
data class CloudEntry @JvmOverloads constructor(
@SerializedName("name")
val name: String,
@SerializedName("data")
// @Base64EncodedArray
val data: ByteArray,
@SerializedName("creation_date")
// @DateAsTimestamp
val creationDate: Date,
@SerializedName("modification_date")
// @DateAsTimestamp
val modificationDate: Date,
@SerializedName("meta")
var meta: Map = mutableMapOf()) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as CloudEntry
if (name != other.name) return false
if (!Arrays.equals(data, other.data)) return false
if (creationDate != other.creationDate) return false
if (modificationDate != other.modificationDate) return false
if (meta != other.meta) return false
return true
}
override fun hashCode(): Int {
var result = name.hashCode()
result = 31 * result + creationDate.hashCode()
return result
}
}
class CloudEntries(map: Map) : Map by map © 2015 - 2025 Weber Informatics LLC | Privacy Policy