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

com.koushikdutta.quack.QuackObject Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
package com.koushikdutta.quack;

public interface QuackObject {
    default Object get(Object key) {
        return null;
    }

    default boolean set(Object key, Object value) {
        return false;
    }

    default boolean has(Object key) {
        return get(key) != null;
    }

    /**
     * Call this object with the expectation that it is a function. The this argument
     * is provided.
     * @param thiz
     * @param args
     * @return
     */
    default Object callMethod(Object thiz, Object... args) {
        throw new UnsupportedOperationException();
    }

    /**
     * Construct this object with the expectation that it is a function. The this argument
     * is provided.
     * @param args
     * @return
     */
    default Object construct(Object... args) {
        throw new UnsupportedOperationException();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy