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

cn.allbs.hj212.feature.ParserFeature Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package cn.allbs.hj212.feature;

/**
 * 解析特性
 * Created by xiaoyao9184 on 2018/1/3.
 */
public enum ParserFeature implements Feature {

    /**
     * 头常量
     */
    HEADER_CONSTANT(true),

    /**
     * 尾常量
     */
    FOOTER_CONSTANT(false);


    private final boolean _defaultState;
    private final int _mask;

    ParserFeature(boolean defaultState) {
        _defaultState = defaultState;
        _mask = (1 << ordinal());
    }

    @Override
    public boolean enabledByDefault() {
        return _defaultState;
    }

    @Override
    public int getMask() {
        return _mask;
    }

    @Override
    public boolean enabledIn(int flags) {
        return (flags & _mask) != 0;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy