All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.javagl.jgltf.impl.v2.GlTFProperty Maven / Gradle / Ivy

The newest version!
/*
 * glTF JSON model
 * 
 * Do not modify this class. It is automatically generated
 * with JsonModelGen (https://github.com/javagl/JsonModelGen)
 * Copyright (c) 2016-2021 Marco Hutter - http://www.javagl.de
 */

package de.javagl.jgltf.impl.v2;

import java.util.LinkedHashMap;
import java.util.Map;


/**
 * Auto-generated for glTFProperty.schema.json 
 * 
 */
public class GlTFProperty {

    /**
     * JSON object with extension-specific objects. (optional) 
     * 
     */
    private Map extensions;
    /**
     * Application-specific data. (optional) 
     * 
     */
    private Object extras;

    /**
     * JSON object with extension-specific objects. (optional) 
     * 
     * @param extensions The extensions to set
     * 
     */
    public void setExtensions(Map extensions) {
        if (extensions == null) {
            this.extensions = extensions;
            return ;
        }
        this.extensions = extensions;
    }

    /**
     * JSON object with extension-specific objects. (optional) 
     * 
     * @return The extensions
     * 
     */
    public Map getExtensions() {
        return this.extensions;
    }

    /**
     * Add the given extensions. The extensions of this instance will be 
     * replaced with a map that contains all previous mappings, and 
     * additionally the new mapping. 
     * 
     * @param key The key
     * @param value The value
     * @throws NullPointerException If the given key or value is null
     * 
     */
    public void addExtensions(String key, Object value) {
        if (key == null) {
            throw new NullPointerException("The key may not be null");
        }
        if (value == null) {
            throw new NullPointerException("The value may not be null");
        }
        Map oldMap = this.extensions;
        Map newMap = new LinkedHashMap();
        if (oldMap!= null) {
            newMap.putAll(oldMap);
        }
        newMap.put(key, value);
        this.extensions = newMap;
    }

    /**
     * Remove the given extensions. The extensions of this instance will be 
     * replaced with a map that contains all previous mappings, except for 
     * the one with the given key.
* If this new map would be empty, then it will be set to * null. * * @param key The key * @throws NullPointerException If the given key is null * */ public void removeExtensions(String key) { if (key == null) { throw new NullPointerException("The key may not be null"); } Map oldMap = this.extensions; Map newMap = new LinkedHashMap(); if (oldMap!= null) { newMap.putAll(oldMap); } newMap.remove(key); if (newMap.isEmpty()) { this.extensions = null; } else { this.extensions = newMap; } } /** * Application-specific data. (optional) * * @param extras The extras to set * */ public void setExtras(Object extras) { if (extras == null) { this.extras = extras; return ; } this.extras = extras; } /** * Application-specific data. (optional) * * @return The extras * */ public Object getExtras() { return this.extras; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy