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

com.landawn.abacus.type.AbstractOptionalType Maven / Gradle / Ivy

Go to download

A general programming library in Java/Android. It's easy to learn and simple to use with concise and powerful APIs.

There is a newer version: 5.2.4
Show newest version
/*
 * Copyright (c) 2016, Haiyang Li. All rights reserved.
 */

package com.landawn.abacus.type;

import java.util.Map;

/**
 *
 * @author Haiyang Li
 * @param 
 * @since 0.8
 */
public abstract class AbstractOptionalType extends AbstractType {

    protected static final String IS_PRESENT = "isPresent";

    protected static final String VALUE = "value";

    private static Type> mapType = null;

    protected AbstractOptionalType(String typeName) {
        super(typeName);
    }

    /**
     * Gets the map type.
     *
     * @return
     */
    protected static synchronized Type> getMapType() {
        if (mapType == null) {
            mapType = TypeFactory.getType("Map");
        }

        return mapType;
    }

    /**
     * Checks if is optional or nullable.
     *
     * @return true, if is optional or nullable
     */
    @Override
    public boolean isOptionalOrNullable() {
        return true;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy