001/*
002 * SPDX-FileCopyrightText: none
003 * SPDX-License-Identifier: CC0-1.0
004 */
005
006package dev.metaschema.core.model;
007
008import edu.umd.cs.findbugs.annotations.NonNull;
009import edu.umd.cs.findbugs.annotations.Nullable;
010
011/**
012 * A marker interface for Metaschema constructs that can have a value.
013 */
014public interface IValued extends IDefaultable {
015  /**
016   * Get the current value from the provided {@code parentInstance} object.
017   * <p>
018   * The provided object must be of the type associated with the definition
019   * containing this instance.
020   *
021   * @param parent
022   *          the object associated with the definition containing this property
023   * @return the value if available, or {@code null} otherwise
024   */
025  // from IInstanceAbsolute
026  @Nullable
027  default Object getValue(@NonNull Object parent) {
028    return getResolvedDefaultValue();
029  }
030}