com.arcadedb.database.Document Maven / Gradle / Ivy
/*
* Copyright © 2021-present Arcade Data Ltd ([email protected])
*
* 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.
*
* SPDX-FileCopyrightText: 2021-present Arcade Data Ltd ([email protected])
* SPDX-License-Identifier: Apache-2.0
*/
package com.arcadedb.database;
import com.arcadedb.schema.DocumentType;
import java.math.*;
import java.time.*;
import java.util.*;
/**
* Document interface. Vertex and Edge both extend the Document interface.
*
* @author Luca Garulli ([email protected])
*/
public interface Document extends Record {
byte RECORD_TYPE = 0;
MutableDocument modify();
DetachedDocument detach();
boolean has(String propertyName);
Object get(String propertyName);
String getString(String propertyName);
Boolean getBoolean(String propertyName);
Byte getByte(String propertyName);
Short getShort(String propertyName);
Integer getInteger(String propertyName);
Long getLong(String propertyName);
Float getFloat(String propertyName);
Double getDouble(String propertyName);
BigDecimal getDecimal(String propertyName);
byte[] getBinary(String propertyName);
Date getDate(String propertyName);
/**
* Returns a java.util.Calendar object from a datetime property.
*
* @since 23.1.1
*/
Calendar getCalendar(String propertyName);
/**
* Returns a java.time.LocalDate object from a date property.
*
* @since 23.1.1
*/
LocalDate getLocalDate(String propertyName);
/**
* Returns a java.time.LocalDateTime object from a datetime property.
*
* @since 23.1.1
*/
LocalDateTime getLocalDateTime(String propertyName);
/**
* Returns a java.time.ZonedDateTime object from a datetime property.
*
* @since 23.1.1
*/
ZonedDateTime getZonedDateTime(String propertyName);
/**
* Returns a java.time.Instant object from a datetime property.
*
* @since 23.1.1
*/
Instant getInstant(String propertyName);
Map getMap(String propertyName);
List getList(String propertyName);
EmbeddedDocument getEmbedded(String propertyName);
Set getPropertyNames();
DocumentType getType();
String getTypeName();
/**
* Returns a map containing the document properties, including metadata such as `@rid`, `@type` and `@cat`.
*/
default Map toMap() {
return toMap(true);
}
/**
* Returns a map containing the document properties.
*
* @param includeMetadata true to include metadata such as `@rid`, `@type` and `@cat`, otherwise only the document properties
*/
Map toMap(boolean includeMetadata);
Map propertiesAsMap();
@Override
default Document asDocument() {
return this;
}
@Override
default Document asDocument(final boolean loadContent) {
return this;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy