static synchronized void addTracker(TrackerHodler trackerHodler)

/*
 *  Copyright Beijing 58 Information Technology Co.,Ltd.
 *
 */
package com.bj58.oceanus.core.timetracker;

import java.util.HashMap;
import java.util.Map;
import com.bj58.oceanus.core.exception.ConfigurationException;
import com.bj58.oceanus.core.timetracker.handler.TrackResult;
import com.google.common.collect.Maps;

/**
 * 耗时监控点以及处理器的持有者，也是监控器的基类
 * 子类实现 {@link #doTrack()} 方法并加入配置，即可实现自定义监控
 *
 * @author Service Platform Architecture Team (example@nnthink.com)
 */
public abstract class Tracker {

    private static final Map<TrackPoint, TrackerHodler> generalTrackerMap = Maps.newHashMap();

    private static final Map<String, Map<TrackPoint, TrackerHodler>> tableTrackerMap = Maps.newHashMap();

    /**
     * 添加全局Tracker
     * @param trackerHodler
     */

{
        if (generalTrackerMap.containsKey(trackerHodler.getTrackPoint()))
            throw new ConfigurationException("TrackPoint [" + trackerHodler.getTrackPoint() + "] already exsit!");
        generalTrackerMap.put(trackerHodler.getTrackPoint(), trackerHodler);
    }

    /**
     * 为指定table添加Tracker
     * @param tableName
     * @param trackerHodler
     */
    static synchronized void addTracker(String tableName, TrackerHodler trackerHodler) {
        if (!tableTrackerMap.containsKey(tableName))
            tableTrackerMap.put(tableName, new HashMap<TrackPoint, TrackerHodler>());
        if (tableTrackerMap.get(tableName).containsKey(trackerHodler.getTrackPoint()))
            throw new ConfigurationException("TrackPoint [" + trackerHodler.getTrackPoint() + "] for table [" + tableName + "] already exsit!");
        tableTrackerMap.get(tableName).put(trackerHodler.getTrackPoint(), trackerHodler);
    }

    /**
     * 获取全局指定类型的 tracker
     * @param trackPoint
     * @return
     */
    static TrackerHodler getTracker(TrackPoint trackPoint) {
        return generalTrackerMap.get(trackPoint);
    }

    /**
     * 获取指定表、指定类型的 tracker
     * @param tableName
     * @param trackPoint
     * @return
     */
    static TrackerHodler getTableTracker(String tableName, TrackPoint trackPoint) {
        if (!tableTrackerMap.containsKey(tableName))
            return null;
        return tableTrackerMap.get(tableName).get(trackPoint);
    }

    /**
     * 当对应的 TrackPoint 执行时间大于 getThreshold() 时的回调方法
     * @param TrackResult
     * 	- tableName 对应的表
     * 	- sql 对应的sql
     * 	- costTime 执行耗时
     */
    public abstract void doTrack(TrackResult trackResult);
}


{
        return generalTrackerMap.get(trackPoint);
    }

/*
 *  Copyright Beijing 58 Information Technology Co.,Ltd.
 *
 */
package com.bj58.oceanus.core.timetracker;

import java.util.HashMap;
import java.util.Map;
import com.bj58.oceanus.core.exception.ConfigurationException;
import com.bj58.oceanus.core.timetracker.handler.TrackResult;
import com.google.common.collect.Maps;

/**
 * 耗时监控点以及处理器的持有者，也是监控器的基类
 * 子类实现 {@link #doTrack()} 方法并加入配置，即可实现自定义监控
 *
 * @author Service Platform Architecture Team (example@nnthink.com)
 */
public abstract class Tracker {

    private static final Map<TrackPoint, TrackerHodler> generalTrackerMap = Maps.newHashMap();

    private static final Map<String, Map<TrackPoint, TrackerHodler>> tableTrackerMap = Maps.newHashMap();

    /**
     * 添加全局Tracker
     * @param trackerHodler
     */
    static synchronized void addTracker(TrackerHodler trackerHodler) {
        if (generalTrackerMap.containsKey(trackerHodler.getTrackPoint()))
            throw new ConfigurationException("TrackPoint [" + trackerHodler.getTrackPoint() + "] already exsit!");
        generalTrackerMap.put(trackerHodler.getTrackPoint(), trackerHodler);
    }

    /**
     * 为指定table添加Tracker
     * @param tableName
     * @param trackerHodler
     */
    static synchronized void addTracker(String tableName, TrackerHodler trackerHodler) {
        if (!tableTrackerMap.containsKey(tableName))
            tableTrackerMap.put(tableName, new HashMap<TrackPoint, TrackerHodler>());
        if (tableTrackerMap.get(tableName).containsKey(trackerHodler.getTrackPoint()))
            throw new ConfigurationException("TrackPoint [" + trackerHodler.getTrackPoint() + "] for table [" + tableName + "] already exsit!");
        tableTrackerMap.get(tableName).put(trackerHodler.getTrackPoint(), trackerHodler);
    }

    /**
     * 获取全局指定类型的 tracker
     * @param trackPoint
     * @return
     */
    static TrackerHodler getTracker(TrackPoint trackPoint)

    /**
     * 获取指定表、指定类型的 tracker
     * @param tableName
     * @param trackPoint
     * @return
     */
    static TrackerHodler getTableTracker(String tableName, TrackPoint trackPoint) {
        if (!tableTrackerMap.containsKey(tableName))
            return null;
        return tableTrackerMap.get(tableName).get(trackPoint);
    }

    /**
     * 当对应的 TrackPoint 执行时间大于 getThreshold() 时的回调方法
     * @param TrackResult
     * 	- tableName 对应的表
     * 	- sql 对应的sql
     * 	- costTime 执行耗时
     */
    public abstract void doTrack(TrackResult trackResult);
}


        if (!tableTrackerMap.containsKey(tableName))
            tableTrackerMap.put(tableName, new HashMap<TrackPoint, TrackerHodler>());

/*
 *  Copyright Beijing 58 Information Technology Co.,Ltd.
 *
 */
package com.bj58.oceanus.core.timetracker;

import java.util.HashMap;
import java.util.Map;
import com.bj58.oceanus.core.exception.ConfigurationException;
import com.bj58.oceanus.core.timetracker.handler.TrackResult;
import com.google.common.collect.Maps;

/**
 * 耗时监控点以及处理器的持有者，也是监控器的基类
 * 子类实现 {@link #doTrack()} 方法并加入配置，即可实现自定义监控
 *
 * @author Service Platform Architecture Team (example@nnthink.com)
 */
public abstract class Tracker {

    private static final Map<TrackPoint, TrackerHodler> generalTrackerMap = Maps.newHashMap();

    private static final Map<String, Map<TrackPoint, TrackerHodler>> tableTrackerMap = Maps.newHashMap();

    /**
     * 添加全局Tracker
     * @param trackerHodler
     */
    static synchronized void addTracker(TrackerHodler trackerHodler) {
        if (generalTrackerMap.containsKey(trackerHodler.getTrackPoint()))
            throw new ConfigurationException("TrackPoint [" + trackerHodler.getTrackPoint() + "] already exsit!");
        generalTrackerMap.put(trackerHodler.getTrackPoint(), trackerHodler);
    }

    /**
     * 为指定table添加Tracker
     * @param tableName
     * @param trackerHodler
     */
    static synchronized void addTracker(String tableName, TrackerHodler trackerHodler) {

        if (tableTrackerMap.get(tableName).containsKey(trackerHodler.getTrackPoint()))
            throw new ConfigurationException("TrackPoint [" + trackerHodler.getTrackPoint() + "] for table [" + tableName + "] already exsit!");
        tableTrackerMap.get(tableName).put(trackerHodler.getTrackPoint(), trackerHodler);
    }

    /**
     * 获取全局指定类型的 tracker
     * @param trackPoint
     * @return
     */
    static TrackerHodler getTracker(TrackPoint trackPoint) {
        return generalTrackerMap.get(trackPoint);
    }

    /**
     * 获取指定表、指定类型的 tracker
     * @param tableName
     * @param trackPoint
     * @return
     */
    static TrackerHodler getTableTracker(String tableName, TrackPoint trackPoint) {
        if (!tableTrackerMap.containsKey(tableName))
            return null;
        return tableTrackerMap.get(tableName).get(trackPoint);
    }

    /**
     * 当对应的 TrackPoint 执行时间大于 getThreshold() 时的回调方法
     * @param TrackResult
     * 	- tableName 对应的表
     * 	- sql 对应的sql
     * 	- costTime 执行耗时
     */
    public abstract void doTrack(TrackResult trackResult);
}


if (tableTrackerMap.get(tableName).containsKey(trackerHodler.getTrackPoint()))
            throw new ConfigurationException("TrackPoint [" + trackerHodler.getTrackPoint() + "] for table [" + tableName + "] already exsit!");

/*
 *  Copyright Beijing 58 Information Technology Co.,Ltd.
 *
 */
package com.bj58.oceanus.core.timetracker;

import java.util.HashMap;
import java.util.Map;
import com.bj58.oceanus.core.exception.ConfigurationException;
import com.bj58.oceanus.core.timetracker.handler.TrackResult;
import com.google.common.collect.Maps;

/**
 * 耗时监控点以及处理器的持有者，也是监控器的基类
 * 子类实现 {@link #doTrack()} 方法并加入配置，即可实现自定义监控
 *
 * @author Service Platform Architecture Team (example@nnthink.com)
 */
public abstract class Tracker {

    private static final Map<TrackPoint, TrackerHodler> generalTrackerMap = Maps.newHashMap();

    private static final Map<String, Map<TrackPoint, TrackerHodler>> tableTrackerMap = Maps.newHashMap();

    /**
     * 添加全局Tracker
     * @param trackerHodler
     */
    static synchronized void addTracker(TrackerHodler trackerHodler) {
        if (generalTrackerMap.containsKey(trackerHodler.getTrackPoint()))
            throw new ConfigurationException("TrackPoint [" + trackerHodler.getTrackPoint() + "] already exsit!");
        generalTrackerMap.put(trackerHodler.getTrackPoint(), trackerHodler);
    }

    /**
     * 为指定table添加Tracker
     * @param tableName
     * @param trackerHodler
     */
    static synchronized void addTracker(String tableName, TrackerHodler trackerHodler) {
        if (!tableTrackerMap.containsKey(tableName))
            tableTrackerMap.put(tableName, new HashMap<TrackPoint, TrackerHodler>());

        tableTrackerMap.get(tableName).put(trackerHodler.getTrackPoint(), trackerHodler);
    }

    /**
     * 获取全局指定类型的 tracker
     * @param trackPoint
     * @return
     */
    static TrackerHodler getTracker(TrackPoint trackPoint) {
        return generalTrackerMap.get(trackPoint);
    }

    /**
     * 获取指定表、指定类型的 tracker
     * @param tableName
     * @param trackPoint
     * @return
     */
    static TrackerHodler getTableTracker(String tableName, TrackPoint trackPoint) {
        if (!tableTrackerMap.containsKey(tableName))
            return null;
        return tableTrackerMap.get(tableName).get(trackPoint);
    }

    /**
     * 当对应的 TrackPoint 执行时间大于 getThreshold() 时的回调方法
     * @param TrackResult
     * 	- tableName 对应的表
     * 	- sql 对应的sql
     * 	- costTime 执行耗时
     */
    public abstract void doTrack(TrackResult trackResult);
}


tableTrackerMap.get(tableName).put(trackerHodler.getTrackPoint(), trackerHodler);
    }

/*
 *  Copyright Beijing 58 Information Technology Co.,Ltd.
 *
 */
package com.bj58.oceanus.core.timetracker;

import java.util.HashMap;
import java.util.Map;
import com.bj58.oceanus.core.exception.ConfigurationException;
import com.bj58.oceanus.core.timetracker.handler.TrackResult;
import com.google.common.collect.Maps;

/**
 * 耗时监控点以及处理器的持有者，也是监控器的基类
 * 子类实现 {@link #doTrack()} 方法并加入配置，即可实现自定义监控
 *
 * @author Service Platform Architecture Team (example@nnthink.com)
 */
public abstract class Tracker {

    private static final Map<TrackPoint, TrackerHodler> generalTrackerMap = Maps.newHashMap();

    private static final Map<String, Map<TrackPoint, TrackerHodler>> tableTrackerMap = Maps.newHashMap();

    /**
     * 添加全局Tracker
     * @param trackerHodler
     */
    static synchronized void addTracker(TrackerHodler trackerHodler) {
        if (generalTrackerMap.containsKey(trackerHodler.getTrackPoint()))
            throw new ConfigurationException("TrackPoint [" + trackerHodler.getTrackPoint() + "] already exsit!");
        generalTrackerMap.put(trackerHodler.getTrackPoint(), trackerHodler);
    }

    /**
     * 为指定table添加Tracker
     * @param tableName
     * @param trackerHodler
     */
    static synchronized void addTracker(String tableName, TrackerHodler trackerHodler) {
        if (!tableTrackerMap.containsKey(tableName))
            tableTrackerMap.put(tableName, new HashMap<TrackPoint, TrackerHodler>());
        if (tableTrackerMap.get(tableName).containsKey(trackerHodler.getTrackPoint()))
            throw new ConfigurationException("TrackPoint [" + trackerHodler.getTrackPoint() + "] for table [" + tableName + "] already exsit!");

    /**
     * 获取全局指定类型的 tracker
     * @param trackPoint
     * @return
     */
    static TrackerHodler getTracker(TrackPoint trackPoint) {
        return generalTrackerMap.get(trackPoint);
    }

    /**
     * 获取指定表、指定类型的 tracker
     * @param tableName
     * @param trackPoint
     * @return
     */
    static TrackerHodler getTableTracker(String tableName, TrackPoint trackPoint) {
        if (!tableTrackerMap.containsKey(tableName))
            return null;
        return tableTrackerMap.get(tableName).get(trackPoint);
    }

    /**
     * 当对应的 TrackPoint 执行时间大于 getThreshold() 时的回调方法
     * @param TrackResult
     * 	- tableName 对应的表
     * 	- sql 对应的sql
     * 	- costTime 执行耗时
     */
    public abstract void doTrack(TrackResult trackResult);
}


/*
 *  Copyright Beijing 58 Information Technology Co.,Ltd.
 *
 */
package com.bj58.oceanus.core.timetracker;

import java.util.HashMap;
import java.util.Map;
import com.bj58.oceanus.core.exception.ConfigurationException;
import com.bj58.oceanus.core.timetracker.handler.TrackResult;
import com.google.common.collect.Maps;

/**
 * 耗时监控点以及处理器的持有者，也是监控器的基类
 * 子类实现 {@link #doTrack()} 方法并加入配置，即可实现自定义监控
 *
 * @author Service Platform Architecture Team (example@nnthink.com)
 */
public abstract class Tracker {

    private static final Map<TrackPoint, TrackerHodler> generalTrackerMap = Maps.newHashMap();

    private static final Map<String, Map<TrackPoint, TrackerHodler>> tableTrackerMap = Maps.newHashMap();

    /**
     * 添加全局Tracker
     * @param trackerHodler
     */
    static synchronized void addTracker(TrackerHodler trackerHodler) {
        if (generalTrackerMap.containsKey(trackerHodler.getTrackPoint()))
            throw new ConfigurationException("TrackPoint [" + trackerHodler.getTrackPoint() + "] already exsit!");
        generalTrackerMap.put(trackerHodler.getTrackPoint(), trackerHodler);
    }

    /**
     * 为指定table添加Tracker
     * @param tableName
     * @param trackerHodler
     */
    static synchronized void addTracker(String tableName, TrackerHodler trackerHodler) {
        if (!tableTrackerMap.containsKey(tableName))
            tableTrackerMap.put(tableName, new HashMap<TrackPoint, TrackerHodler>());
        if (tableTrackerMap.get(tableName).containsKey(trackerHodler.getTrackPoint()))
            throw new ConfigurationException("TrackPoint [" + trackerHodler.getTrackPoint() + "] for table [" + tableName + "] already exsit!");
        tableTrackerMap.get(tableName).put(trackerHodler.getTrackPoint(), trackerHodler);
    }

    /**
     * 获取全局指定类型的 tracker
     * @param trackPoint
     * @return
     */
    static TrackerHodler getTracker(TrackPoint trackPoint) {
        return generalTrackerMap.get(trackPoint);
    }

    /**
     * 获取指定表、指定类型的 tracker
     * @param tableName
     * @param trackPoint
     * @return
     */
    static TrackerHodler getTableTracker(String tableName, TrackPoint trackPoint) {
        if (!tableTrackerMap.containsKey(tableName))
            return null;
        return tableTrackerMap.get(ta

    }

    /**
     * 当对应的 TrackPoint 执行时间大于 getThreshold() 时的回调方法
     * @param TrackResult
     * 	- tableName 对应的表
     * 	- sql 对应的sql
     * 	- costTime 执行耗时
     */
    public abstract void doTrack(TrackResult trackResult);
}


static TrackerHodler getTableTracker(String tableName, TrackPoint trackPoint) {
        if (!tableTrackerMap.containsKey(tableName))
            return null;
        return tableTrackerMap.get(tableName).get(trackPoint);
    }

/*
 *  Copyright Beijing 58 Information Technology Co.,Ltd.
 *
 */
package com.bj58.oceanus.core.timetracker;

import java.util.HashMap;
import java.util.Map;
import com.bj58.oceanus.core.exception.ConfigurationException;
import com.bj58.oceanus.core.timetracker.handler.TrackResult;
import com.google.common.collect.Maps;

/**
 * 耗时监控点以及处理器的持有者，也是监控器的基类
 * 子类实现 {@link #doTrack()} 方法并加入配置，即可实现自定义监控
 *
 * @author Service Platform Architecture Team (example@nnthink.com)
 */
public abstract class Tracker {

    private static final Map<TrackPoint, TrackerHodler> generalTrackerMap = Maps.newHashMap();

    private static final Map<String, Map<TrackPoint, TrackerHodler>> tableTrackerMap = Maps.newHashMap();

    /**
     * 添加全局Tracker
     * @param trackerHodler
     */
    static synchronized void addTracker(TrackerHodler trackerHodler) {
        if (generalTrackerMap.containsKey(trackerHodler.getTrackPoint()))
            throw new ConfigurationException("TrackPoint [" + trackerHodler.getTrackPoint() + "] already exsit!");
        generalTrackerMap.put(trackerHodler.getTrackPoint(), trackerHodler);
    }

    /**
     * 为指定table添加Tracker
     * @param tableName
     * @param trackerHodler
     */
    static synchronized void addTracker(String tableName, TrackerHodler trackerHodler) {
        if (!tableTrackerMap.containsKey(tableName))
            tableTrackerMap.put(tableName, new HashMap<TrackPoint, TrackerHodler>());
        if (tableTrackerMap.get(tableName).containsKey(trackerHodler.getTrackPoint()))
            throw new ConfigurationException("TrackPoint [" + trackerHodler.getTrackPoint() + "] for table [" + tableName + "] already exsit!");
        tableTrackerMap.get(tableName).put(trackerHodler.getTrackPoint(), trackerHodler);
    }

    /**
     * 获取全局指定类型的 tracker
     * @param trackPoint
     * @return
     */
    static TrackerHodler getTracker(TrackPoint trackPoint) {
        return generalTrackerMap.get(trackPoint);
    }

    /**
     * 获取指定表、指定类型的 tracker
     * @param tableName
     * @param trackPoint
     * @return
     */

    /**
     * 当对应的 TrackPoint 执行时间大于 getThreshold() 时的回调方法
     * @param TrackResult
     * 	- tableName 对应的表
     * 	- sql 对应的sql
     * 	- costTime 执行耗时
     */
    public abstract void doTrack(TrackResult trackResult);
}


if (!tableTrackerMap.containsKey(tableName))
            tableTrackerMap.put(tableName, new HashMap<TrackPoint, TrackerHodler>());


package stericson.busybox.jobs;

import android.app.Activity;
import stericson.busybox.R;
import stericson.busybox.interfaces.JobCallback;
import stericson.busybox.jobs.containers.JobResult;
import stericson.busybox.jobs.tasks.InitialChecksTask;

public class InitialChecksJob extends AsyncJob {

    public final static int Checks = 456214;

    private JobCallback cb;

    public InitialChecksJob(Activity activity, JobCallback cb) {
        super(activity, R.string.initialChecks, false, false);
        this.cb = cb;
    }

{
        return InitialChecksTask.execute(this);
    }

    @Override
    protected void onProgressUpdate(Object... values) {
        super.onProgressUpdate(values);
    }

    @Override
    void callback(JobResult result) {
        cb.jobFinished(result, Checks);
    }
}


{
        return InitialChecksTask.execute(this);
    }

package stericson.busybox.jobs;

import android.app.Activity;
import stericson.busybox.R;
import stericson.busybox.interfaces.JobCallback;
import stericson.busybox.jobs.containers.JobResult;
import stericson.busybox.jobs.tasks.InitialChecksTask;

public class InitialChecksJob extends AsyncJob {

    public final static int Checks = 456214;

    private JobCallback cb;

    public InitialChecksJob(Activity activity, JobCallback cb) {
        super(activity, R.string.initialChecks, false, false);
        this.cb = cb;
    }

    @Override
    JobResult handle()

    @Override
    protected void onProgressUpdate(Object... values) {
        super.onProgressUpdate(values);
    }

    @Override
    void callback(JobResult result) {
        cb.jobFinished(result, Checks);
    }
}


package stericson.busybox.jobs;

import android.app.Activity;
import stericson.busybox.R;
import stericson.busybox.interfaces.JobCallback;
import stericson.busybox.jobs.containers.JobResult;
import stericson.busybox.jobs.tasks.InitialChecksTask;

public class InitialChecksJob extends AsyncJob {

    public final static int Checks = 456214;

    private JobCallback cb;

    public InitialChecksJob(Activity activity, JobCallback cb) {
        super(activity, R.string.initialChecks, false, false);
        this.cb = cb;
    }

    @Override
    JobResult handle() {
        return Init

    }

    @Override
    protected void onProgressUpdate(Object... values) {
        super.onProgressUpdate(values);
    }

    @Override
    void callback(JobResult result) {
        cb.jobFinished(result, Checks);
    }
}


/*
 *
 * example@nnthink.com
 *
 * This software is a computer program whose purpose is to implement a digital archiving back-office system managing
 * high volumetry securely and efficiently.
 *
 * circulated by CEA, CNRS and INRIA at the following URL "https://cecill.info".
 *
 * As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
 * users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the
 * successive licensors have only limited liability.
 *
 * In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or
 * developing or reproducing the software by the user in light of its specific status of free software, that may mean
 * that it is complicated to manipulate, and that also therefore means that it is reserved for developers and
 * experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the
 * software's suitability as regards their requirements in conditions enabling the security of their systems and/or data
 * to be ensured and, more generally, to use and operate it in the same conditions as regards security.
 *
 * accept its terms.
 */
package fr.gouv.vitam.logbook.common.model;

import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import fr.gouv.vitam.logbook.common.parameters.LogbookLifeCycleObjectGroupParameters;

public class LogbookLifeCycleObjectGroupModel implements LogbookLifeCycleModel {

    private String id;

    private Collection<LogbookLifeCycleObjectGroupParameters> logbookLifeCycleParameters;

    /**
     * Constructor
     *
     * @param id lfc id
     * @param logbookLifeCycleParameters lfc parameters
     */
    @JsonCreator
    public LogbookLifeCycleObjectGroupModel(@JsonProperty("id") String id, @JsonProperty("logbookLifeCycleParameters") Collection<LogbookLifeCycleObjectGroupParameters> logbookLifeCycleParameters) {
        this.id = id;
        this.logbookLifeCycleParameters = logbookLifeCycleParameters;
    }

    @Override
    public Collection<LogbookLifeCycleObjectGroupParameters> getLogbookLifeCycleParameters() {
        return logbookLifeCycleParameters;
    }


{
        return logbookLifeCycleParameters;
    }

/*
 *
 * example@nnthink.com
 *
 * This software is a computer program whose purpose is to implement a digital archiving back-office system managing
 * high volumetry securely and efficiently.
 *
 * circulated by CEA, CNRS and INRIA at the following URL "https://cecill.info".
 *
 * As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
 * users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the
 * successive licensors have only limited liability.
 *
 * In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or
 * developing or reproducing the software by the user in light of its specific status of free software, that may mean
 * that it is complicated to manipulate, and that also therefore means that it is reserved for developers and
 * experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the
 * software's suitability as regards their requirements in conditions enabling the security of their systems and/or data
 * to be ensured and, more generally, to use and operate it in the same conditions as regards security.
 *
 * accept its terms.
 */
package fr.gouv.vitam.logbook.common.model;

import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import fr.gouv.vitam.logbook.common.parameters.LogbookLifeCycleObjectGroupParameters;

public class LogbookLifeCycleObjectGroupModel implements LogbookLifeCycleModel {

    private String id;

    private Collection<LogbookLifeCycleObjectGroupParameters> logbookLifeCycleParameters;

    /**
     * Constructor
     *
     * @param id lfc id
     * @param logbookLifeCycleParameters lfc parameters
     */
    @JsonCreator
    public LogbookLifeCycleObjectGroupModel(@JsonProperty("id") String id, @JsonProperty("logbookLifeCycleParameters") Collection<LogbookLifeCycleObjectGroupParameters> logbookLifeCycleParameters) {
        this.id = id;
        this.logbookLifeCycleParameters = logbookLifeCycleParameters;
    }

    @Override
    public Collection<LogbookLifeCycleObjectGroupParameters> getLogbookLifeCycleParameters()

    public String getId() {
        return id;
    }
}


/*
 *
 * example@nnthink.com
 *
 * This software is a computer program whose purpose is to implement a digital archiving back-office system managing
 * high volumetry securely and efficiently.
 *
 * circulated by CEA, CNRS and INRIA at the following URL "https://cecill.info".
 *
 * As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
 * users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the
 * successive licensors have only limited liability.
 *
 * In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or
 * developing or reproducing the software by the user in light of its specific status of free software, that may mean
 * that it is complicated to manipulate, and that also therefore means that it is reserved for developers and
 * experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the
 * software's suitability as regards their requirements in conditions enabling the security of their systems and/or data
 * to be ensured and, more generally, to use and operate it in the same conditions as regards security.
 *
 * accept its terms.
 */
package fr.gouv.vitam.logbook.common.model;

import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import fr.gouv.vitam.logbook.common.parameters.LogbookLifeCycleObjectGroupParameters;

public class LogbookLifeCycleObjectGroupModel implements LogbookLifeCycleModel {

    private String id;

    private Collection<LogbookLifeCycleObjectGroupParameters> logbookLifeCycleParameters;

    /**
     * Constructor
     *
     * @param id lfc id
     * @param logbookLifeCycleParameters lfc parameters
     */
    @JsonCreator
    public LogbookLifeCycleObjectGroupModel(@JsonProperty("id") String id, @JsonProperty("logbookLifeCycleParameters") Collection<LogbookLifeCycleObjectGroupParameters> logbookLifeCycleParameters) {
        this.id = id;
        this.logbookLifeCycleParameters = logbookLifeCycleParameters;
    }

    @Override
    public Collection<LogbookLifeCycleObjectGroupParameters> getLogbookLifeCycleParameters() {

    }

    public String getId() {
        return id;
    }
}


@NotNull
    @Override
    public Lexer getHighlightingLexer()

package com.thoughtworks.gauge.highlight;

import com.intellij.lexer.Lexer;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
import com.intellij.psi.TokenType;
import com.intellij.psi.tree.IElementType;
import com.thoughtworks.gauge.language.token.SpecTokenTypes;
import com.thoughtworks.gauge.lexer.SpecLexer;
import org.jetbrains.annotations.NotNull;

/**
 * A class that describes what highlighting styles should be applied to various tokens (headings, comments, etc) in a
 * Gauge specification (.spec) file.
 */
final class SpecSyntaxHighlighter extends SyntaxHighlighterBase {

{
        return new SpecLexer();
    }

    @Override
    public TextAttributesKey @NotNull [] getTokenHighlights(IElementType tokenType) {
        if (tokenType.equals(SpecTokenTypes.SPEC_HEADING)) {
            return HighlighterTokens.SPEC_HEADING_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.SCENARIO_HEADING)) {
            return HighlighterTokens.SCENARIO_HEADING_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.STEP)) {
            return HighlighterTokens.STEP_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.COMMENT)) {
            return HighlighterTokens.COMMENT_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_HEADER)) {
            return HighlighterTokens.TABLE_HEADER_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_ROW_VALUE)) {
            return HighlighterTokens.TABLE_ROW_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TAGS)) {
            return HighlighterTokens.TAGS_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_BORDER)) {
            return HighlighterTokens.TABLE_BORDER_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.ARG_START) || tokenType.equals(SpecTokenTypes.ARG) || tokenType.equals(SpecTokenTypes.ARG_END)) {
            return HighlighterTokens.ARG_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.DYNAMIC_ARG_START) || tokenType.equals(SpecTokenTypes.DYNAMIC_ARG) || tokenType.equals(SpecTokenTypes.DYNAMIC_ARG_END)) {
            return HighlighterTokens.DYNAMIC_ARG_ATTRIBUTE;
        } else if (tokenType.equals(TokenType.BAD_CHARACTER)) {
            return HighlighterTokens.BAD_CHAR_KEYS;
        } else if (tokenType.equals((SpecTokenTypes.KEYWORD))) {
            return HighlighterTokens.KEYWORD_ATTRIBUTE;
        } else {
            return HighlighterTokens.EMPTY_KEYS;
        }
    }
}


package com.thoughtworks.gauge.highlight;

import com.intellij.lexer.Lexer;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
import com.intellij.psi.TokenType;
import com.intellij.psi.tree.IElementType;
import com.thoughtworks.gauge.language.token.SpecTokenTypes;
import com.thoughtworks.gauge.lexer.SpecLexer;
import org.jetbrains.annotations.NotNull;

/**
 * A class that describes what highlighting styles should be applied to various tokens (headings, comments, etc) in a
 * Gauge specification (.spec) file.
 */
final class SpecSyntaxHighlighter extends SyntaxHighlighterBase {

    @NotNull
    @Override
    public Lexer getHighlightingLexer()

    @Override
    public TextAttributesKey @NotNull [] getTokenHighlights(IElementType tokenType) {
        if (tokenType.equals(SpecTokenTypes.SPEC_HEADING)) {
            return HighlighterTokens.SPEC_HEADING_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.SCENARIO_HEADING)) {
            return HighlighterTokens.SCENARIO_HEADING_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.STEP)) {
            return HighlighterTokens.STEP_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.COMMENT)) {
            return HighlighterTokens.COMMENT_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_HEADER)) {
            return HighlighterTokens.TABLE_HEADER_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_ROW_VALUE)) {
            return HighlighterTokens.TABLE_ROW_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TAGS)) {
            return HighlighterTokens.TAGS_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_BORDER)) {
            return HighlighterTokens.TABLE_BORDER_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.ARG_START) || tokenType.equals(SpecTokenTypes.ARG) || tokenType.equals(SpecTokenTypes.ARG_END)) {
            return HighlighterTokens.ARG_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.DYNAMIC_ARG_START) || tokenType.equals(SpecTokenTypes.DYNAMIC_ARG) || tokenType.equals(SpecTokenTypes.DYNAMIC_ARG_END)) {
            return HighlighterTokens.DYNAMIC_ARG_ATTRIBUTE;
        } else if (tokenType.equals(TokenType.BAD_CHARACTER)) {
            return HighlighterTokens.BAD_CHAR_KEYS;
        } else if (tokenType.equals((SpecTokenTypes.KEYWORD))) {
            return HighlighterTokens.KEYWORD_ATTRIBUTE;
        } else {
            return HighlighterTokens.EMPTY_KEYS;
        }
    }
}


package com.thoughtworks.gauge.highlight;

import com.intellij.lexer.Lexer;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
import com.intellij.psi.TokenType;
import com.intellij.psi.tree.IElementType;
import com.thoughtworks.gauge.language.token.SpecTokenTypes;
import com.thoughtworks.gauge.lexer.SpecLexer;
import org.jetbrains.annotations.NotNull;

/**
 * A class that describes what highlighting styles should be applied to various tokens (headings, comments, etc) in a
 * Gauge specification (.spec) file.
 */
final class SpecSyntaxHighlighter extends SyntaxHighlighterBase {

    @NotNull
    @Override
    public Lexer getHighlightingLexer() {
        return new SpecLexer();
    }

    @Override
    public TextAttributesKey @NotNull [] getTokenHighlights(IElementType tokenType) {

        if (tokenType.equals(SpecTokenTypes.SPEC_HEADING)) {
            return HighlighterTokens.SPEC_HEADING_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.SCENARIO_HEADING)) {
            return HighlighterTokens.SCENARIO_HEADING_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.STEP)) {
            return HighlighterTokens.STEP_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.COMMENT)) {
            return HighlighterTokens.COMMENT_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_HEADER)) {
            return HighlighterTokens.TABLE_HEADER_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_ROW_VALUE)) {
            return HighlighterTokens.TABLE_ROW_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TAGS)) {
            return HighlighterTokens.TAGS_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_BORDER)) {
            return HighlighterTokens.TABLE_BORDER_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.ARG_START) || tokenType.equals(SpecTokenTypes.ARG) || tokenType.equals(SpecTokenTypes.ARG_END)) {
            return HighlighterTokens.ARG_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.DYNAMIC_ARG_START) || tokenType.equals(SpecTokenTypes.DYNAMIC_ARG) || tokenType.equals(SpecTokenTypes.DYNAMIC_ARG_END)) {
            return HighlighterTokens.DYNAMIC_ARG_ATTRIBUTE;
        } else if (tokenType.equals(TokenType.BAD_CHARACTER)) {
            return HighlighterTokens.BAD_CHAR_KEYS;
        } else if (tokenType.equals((SpecTokenTypes.KEYWORD))) {
            return HighlighterTokens.KEYWORD_ATTRIBUTE;
        } else {
            return HighlighterTokens.EMPTY_KEYS;
        }
    }
}


if (tokenType.equals(SpecTokenTypes.SPEC_HEADING)) {
            return HighlighterTokens.SPEC_HEADING_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.SCENARIO_HEADING)) {
            return HighlighterTokens.SCENARIO_HEADING_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.STEP)) {
            return HighlighterTokens.STEP_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.COMMENT)) {
            return HighlighterTokens.COMMENT_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_HEADER)) {
            return HighlighterTokens.TABLE_HEADER_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_ROW_VALUE)) {
            return HighlighterTokens.TABLE_ROW_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TAGS)) {
            return HighlighterTokens.TAGS_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_BORDER)) {
            return HighlighterTokens.TABLE_BORDER_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.ARG_START) || tokenType.equals(SpecTokenTypes.ARG) || tokenType.equals(SpecTokenTypes.ARG_END)) {
            return HighlighterTokens.ARG_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.DYNAMIC_ARG_START) || tokenType.equals(SpecTokenTypes.DYNAMIC_ARG) || tokenType.equals(SpecTokenTypes.DYNAMIC_ARG_END)) {
            return HighlighterTokens.DYNAMIC_ARG_ATTRIBUTE;
        } else if (tokenType.equals(TokenType.BAD_CHARACTER)) {
            return HighlighterTokens.BAD_CHAR_KEYS;
        } else if (tokenType.equals((SpecTokenTypes.KEYWORD))) {
            return HighlighterTokens.KEYWORD_ATTRIBUTE;
        } else {
            return HighlighterTokens.EMPTY_KEYS;
        }


package com.thoughtworks.gauge.highlight;

import com.intellij.lexer.Lexer;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
import com.intellij.psi.TokenType;
import com.intellij.psi.tree.IElementType;
import com.thoughtworks.gauge.language.token.SpecTokenTypes;
import com.thoughtworks.gauge.lexer.SpecLexer;
import org.jetbrains.annotations.NotNull;

/**
 * A class that describes what highlighting styles should be applied to various tokens (headings, comments, etc) in a
 * Gauge specification (.spec) file.
 */
final class SpecSyntaxHighlighter extends SyntaxHighlighterBase {

    @NotNull
    @Override
    public Lexer getHighlightingLexer() {
        return new SpecLexer();
    }

    @Override
    public TextAttributesKey @NotNull [] getTokenHighlights(IElementType tokenType) {
        if (tokenType.equals(SpecTokenTypes.SPEC_HEADING)) {
            return HighlighterTokens.SPEC_HEADING_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.SCENARIO_HEADING)) {
            return HighlighterTokens.SCENARIO_HEADING_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.STEP)) {
            return HighlighterTokens.STEP_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.COMMENT)) {
            return HighlighterTokens.COMMENT_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_HEADER)) {
            return HighlighterTokens.TABLE_HEADER_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_ROW_VALUE)) {
            return HighlighterTokens.TABLE_ROW_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TAGS)) {
            return HighlighterTokens.TAGS_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_BORDER)) {
            return HighlighterTokens.TABLE_BORDER_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.ARG_START) || tokenType.equals(SpecTokenTypes.ARG) || tokenType.equals(SpecTokenTypes.ARG_END)) {
            return HighlighterTokens.ARG_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.DYNAMIC_ARG_START) || tokenType.equals(SpecTokenTypes.DYNAMIC_ARG) || tokenType.equals(SpecTokenTypes.DYNAMIC_ARG_END)) {
            return HighlighterTokens.DYNAMIC_ARG_ATTRIBUTE;
        } else if (tokenType.equals(TokenType.BAD_CHARACTER)) {
            return HighlighterTokens.BAD_CHAR_KEYS;
        } else if (tokenType.equals((SpecTokenTypes.KEYWORD))) {
            return HighlighterTokens.KEYWORD_ATTRIBUTE;
        } else {
            return HighlighterTokens.EMPTY_KEYS;
        }


package com.thoughtworks.gauge.highlight;

import com.intellij.lexer.Lexer;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
import com.intellij.psi.TokenType;
import com.intellij.psi.tree.IElementType;
import com.thoughtworks.gauge.language.token.SpecTokenTypes;
import com.thoughtworks.gauge.lexer.SpecLexer;
import org.jetbrains.annotations.NotNull;

/**
 * A class that describes what highlighting styles should be applied to various tokens (headings, comments, etc) in a
 * Gauge specification (.spec) file.
 */
final class SpecSyntaxHighlighter extends SyntaxHighlighterBase {

    @NotNull
    @Override
    public Lexer getHighlightingLexer() {

    }

    @Override
    public TextAttributesKey @NotNull [] getTokenHighlights(IElementType tokenType) {
        if (tokenType.equals(SpecTokenTypes.SPEC_HEADING)) {
            return HighlighterTokens.SPEC_HEADING_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.SCENARIO_HEADING)) {
            return HighlighterTokens.SCENARIO_HEADING_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.STEP)) {
            return HighlighterTokens.STEP_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.COMMENT)) {
            return HighlighterTokens.COMMENT_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_HEADER)) {
            return HighlighterTokens.TABLE_HEADER_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_ROW_VALUE)) {
            return HighlighterTokens.TABLE_ROW_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TAGS)) {
            return HighlighterTokens.TAGS_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_BORDER)) {
            return HighlighterTokens.TABLE_BORDER_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.ARG_START) || tokenType.equals(SpecTokenTypes.ARG) || tokenType.equals(SpecTokenTypes.ARG_END)) {
            return HighlighterTokens.ARG_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.DYNAMIC_ARG_START) || tokenType.equals(SpecTokenTypes.DYNAMIC_ARG) || tokenType.equals(SpecTokenTypes.DYNAMIC_ARG_END)) {
            return HighlighterTokens.DYNAMIC_ARG_ATTRIBUTE;
        } else if (tokenType.equals(TokenType.BAD_CHARACTER)) {
            return HighlighterTokens.BAD_CHAR_KEYS;
        } else if (tokenType.equals((SpecTokenTypes.KEYWORD))) {
            return HighlighterTokens.KEYWORD_ATTRIBUTE;
        } else {
            return HighlighterTokens.EMPTY_KEYS;
        }
    }
}


if (tokenType.equals(TokenType.BAD_CHARACTER)) {
            return HighlighterTokens.BAD_CHAR_KEYS;
        } else if (tokenType.equals((SpecTokenTypes.KEYWORD))) {
            return HighlighterTokens.KEYWORD_ATTRIBUTE;
        } else {
            return HighlighterTokens.EMPTY_KEYS;
        }

package com.thoughtworks.gauge.highlight;

import com.intellij.lexer.Lexer;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
import com.intellij.psi.TokenType;
import com.intellij.psi.tree.IElementType;
import com.thoughtworks.gauge.language.token.SpecTokenTypes;
import com.thoughtworks.gauge.lexer.SpecLexer;
import org.jetbrains.annotations.NotNull;

/**
 * A class that describes what highlighting styles should be applied to various tokens (headings, comments, etc) in a
 * Gauge specification (.spec) file.
 */
final class SpecSyntaxHighlighter extends SyntaxHighlighterBase {

    @NotNull
    @Override
    public Lexer getHighlightingLexer() {
        return new SpecLexer();
    }

    @Override
    public TextAttributesKey @NotNull [] getTokenHighlights(IElementType tokenType) {
        if (tokenType.equals(SpecTokenTypes.SPEC_HEADING)) {
            return HighlighterTokens.SPEC_HEADING_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.SCENARIO_HEADING)) {
            return HighlighterTokens.SCENARIO_HEADING_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.STEP)) {
            return HighlighterTokens.STEP_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.COMMENT)) {
            return HighlighterTokens.COMMENT_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_HEADER)) {
            return HighlighterTokens.TABLE_HEADER_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_ROW_VALUE)) {
            return HighlighterTokens.TABLE_ROW_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TAGS)) {
            return HighlighterTokens.TAGS_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.TABLE_BORDER)) {
            return HighlighterTokens.TABLE_BORDER_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.ARG_START) || tokenType.equals(SpecTokenTypes.ARG) || tokenType.equals(SpecTokenTypes.ARG_END)) {
            return HighlighterTokens.ARG_ATTRIBUTE;
        } else if (tokenType.equals(SpecTokenTypes.DYNAMIC_ARG_START) || tokenType.equals(SpecTokenTypes.DYNAMIC_ARG) || tokenType.equals(SpecTokenTypes.DYNAMIC_ARG_END)) {
            return HighlighterTokens.DYNAMIC_ARG_ATTRIBUTE;
        } else


@Override
    public Object toObject(Object object, PDataType actualType)

package org.apache.phoenix.schema.types;

import org.apache.hadoop.hbase.util.Bytes;
import org.apache.phoenix.schema.SortOrder;
import org.apache.phoenix.thirdparty.com.google.common.base.Preconditions;

public class PUnsignedTinyint extends PWholeNumber<Byte> {

    public static final PUnsignedTinyint INSTANCE = new PUnsignedTinyint();

    private PUnsignedTinyint() {
        super("UNSIGNED_TINYINT", 11, Byte.class, new UnsignedByteCodec(), 18);
    }

    @Override
    public Integer getScale(Object o) {
        return ZERO;
    }

    @Override
    public int compareTo(Object lhs, Object rhs, PDataType rhsType) {
        return PLong.INSTANCE.compareTo(lhs, rhs, rhsType);
    }

    @Override
    public boolean isFixedWidth() {
        return true;
    }

    @Override
    public Integer getByteSize() {
        return Bytes.SIZEOF_BYTE;
    }

    @Override
    public Integer getMaxLength(Object o) {
        return BYTE_PRECISION;
    }

    @Override
    public byte[] toBytes(Object object) {
        byte[] b = new byte[Bytes.SIZEOF_BYTE];
        toBytes(object, b, 0);
        return b;
    }

    @Override
    public int toBytes(Object object, byte[] bytes, int offset) {
        if (object == null) {
            throw newIllegalDataException(this + " may not be null");
        }
        return this.getCodec().encodeByte(((Number) object).byteValue(), bytes, offset);
    }

    @Override
    public Object toObject(String value) {
        if (value == null || value.length() == 0) {
            return null;
        }
        try {
            Byte b = Byte.parseByte(value);
            if (b.byteValue() < 0) {
                throw newIllegalDataException("Value may not be negative(" + b + ")");
            }
            return b;
        } catch (NumberFormatException e) {
            throw newIllegalDataException(e);
        }
    }

{
        Byte v = (Byte) PTinyint.INSTANCE.toObject(object, actualType);
        throwIfNonNegativeNumber(v);
        return v;
    }

    @Override
    public Object toObject(byte[] b, int o, int l, PDataType actualType, SortOrder sortOrder, Integer maxLength, Integer scale) {
        Byte v = (Byte) PTinyint.INSTANCE.toObject(b, o, l, actualType, sortOrder);
        throwIfNonNegativeNumber(v);
        return v;
    }

    @Override
    public boolean isCoercibleTo(PDataType targetType) {
        return targetType.equals(this) || PUnsignedSmallint.INSTANCE.isCoercibleTo(targetType) || PTinyint.INSTANCE.isCoercibleTo(targetType);
    }

    @Override
    public boolean isCoercibleTo(PDataType targetType, Object value) {
        return super.isCoercibleTo(targetType, value) || PTinyint.INSTANCE.isCoercibleTo(targetType, value);
    }

    @Override
    public boolean isComparableTo(PDataType targetType) {
        return PDecimal.INSTANCE.isComparableTo(targetType);
    }

    @Override
    public int getResultSetSqlType() {
        return PTinyint.INSTANCE.getResultSetSqlType();
    }

    @Override
    public Object getSampleValue(Integer maxLength, Integer arrayLength) {
        return ((Integer) RANDOM.get().nextInt(Byte.MAX_VALUE)).byteValue();
    }

    static class UnsignedByteCodec extends PTinyint.ByteCodec {

        @Override
        public byte decodeByte(byte[] b, int o, SortOrder sortOrder) {
            Preconditions.checkNotNull(sortOrder);
            checkForSufficientLength(b, o, Bytes.SIZEOF_BYTE);
            byte v = b[o];
            if (sortOrder == SortOrder.DESC) {
                v = SortOrder.invert(v);
            }
            if (v < 0) {
                throw newIllegalDataException();
            }
            return v;
        }

        @Override
        public int encodeByte(byte v, byte[] b, int o) {
            if (v < 0) {
                throw newIllegalDataException();
            }
            Bytes.putByte(b, o, v);
            return Bytes.SIZEOF_BYTE;
        }
    }
}


{
            Preconditions.checkNotNull(sortOrder);
            checkForSufficientLength(b, o, Bytes.SIZEOF_BYTE);
            byte v = b[o];
            if (sortOrder == SortOrder.DESC) {
                v = SortOrder.invert(v);
            }
            if (v < 0) {
                throw newIllegalDataException();
            }
            return v;
        }

package org.apache.phoenix.schema.types;

import org.apache.hadoop.hbase.util.Bytes;
import org.apache.phoenix.schema.SortOrder;
import org.apache.phoenix.thirdparty.com.google.common.base.Preconditions;

public class PUnsignedTinyint extends PWholeNumber<Byte> {

    public static final PUnsignedTinyint INSTANCE = new PUnsignedTinyint();

    private PUnsignedTinyint() {
        super("UNSIGNED_TINYINT", 11, Byte.class, new UnsignedByteCodec(), 18);
    }

    @Override
    public Integer getScale(Object o) {
        return ZERO;
    }

    @Override
    public int compareTo(Object lhs, Object rhs, PDataType rhsType) {
        return PLong.INSTANCE.compareTo(lhs, rhs, rhsType);
    }

    @Override
    public boolean isFixedWidth() {
        return true;
    }

    @Override
    public Integer getByteSize() {
        return Bytes.SIZEOF_BYTE;
    }

    @Override
    public Integer getMaxLength(Object o) {
        return BYTE_PRECISION;
    }

    @Override
    public byte[] toBytes(Object object) {
        byte[] b = new byte[Bytes.SIZEOF_BYTE];
        toBytes(object, b, 0);
        return b;
    }

    @Override
    public int toBytes(Object object, byte[] bytes, int offset) {
        if (object == null) {
            throw newIllegalDataException(this + " may not be null");
        }
        return this.getCodec().encodeByte(((Number) object).byteValue(), bytes, offset);
    }

    @Override
    public Object toObject(String value) {
        if (value == null || value.length() == 0) {
            return null;
        }
        try {
            Byte b = Byte.parseByte(value);
            if (b.byteValue() < 0) {
                throw newIllegalDataException("Value may not be negative(" + b + ")");
            }
            return b;
        } catch (NumberFormatException e) {
            throw newIllegalDataException(e);
        }
    }

    @Override
    public Object toObject(Object object, PDataType actualType) {
        Byte v = (Byte) PTinyint.INSTANCE.toObject(object, actualType);
        throwIfNonNegativeNumber(v);
        return v;
    }

    @Override
    public Object toObject(byte[] b, int o, int l, PDataType actualType, SortOrder sortOrder, Integer maxLength, Integer scale) {
        Byte v = (Byte) PTinyint.INSTANCE.toObject(b, o, l, actualType, sortOrder);
        throwIfNonNegativeNumber(v);
        return v;
    }

    @Override
    public boolean isCoercibleTo(PDataType targetType) {
        return targetType.equals(this) || PUnsignedSmallint.INSTANCE.isCoercibleTo(targetType) || PTinyint.INSTANCE.isCoercibleTo(targetType);
    }

    @Override
    public boolean isCoercibleTo(PDataType targetType, Object value) {
        return super.isCoercibleTo(targetType, value) || PTinyint.INSTANCE.isCoercibleTo(targetType, value);
    }

    @Override
    public boolean isComparableTo(PDataType targetType) {
        return PDecimal.INSTANCE.isComparableTo(targetType);
    }

    @Override
    public int getResultSetSqlType() {
        return PTinyint.INSTANCE.getResultSetSqlType();
    }

    @Override
    public Object getSampleValue(Integer maxLength, Integer arrayLength) {
        return ((Integer) RANDOM.get().nextInt(Byte.MAX_VALUE)).byteValue();
    }

    static class UnsignedByteCodec extends PTinyint.ByteCodec {

        @Override
        public byte decodeByte(byte[] b, int o, SortOrder sortOrder)

        @Override
        public int encodeByte(byte v, byte[] b, int o) {
            if (v < 0) {
                throw newIllegalDataException();
            }
            Bytes.putByte(b, o, v);
            return Bytes.SIZEOF_BYTE;
        }
    }
}


        if (value == null || value.length() == 0) {
            return null;
        }

package org.apache.phoenix.schema.types;

import org.apache.hadoop.hbase.util.Bytes;
import org.apache.phoenix.schema.SortOrder;
import org.apache.phoenix.thirdparty.com.google.common.base.Preconditions;

public class PUnsignedTinyint extends PWholeNumber<Byte> {

    public static final PUnsignedTinyint INSTANCE = new PUnsignedTinyint();

    private PUnsignedTinyint() {
        super("UNSIGNED_TINYINT", 11, Byte.class, new UnsignedByteCodec(), 18);
    }

    @Override
    public Integer getScale(Object o) {
        return ZERO;
    }

    @Override
    public int compareTo(Object lhs, Object rhs, PDataType rhsType) {
        return PLong.INSTANCE.compareTo(lhs, rhs, rhsType);
    }

    @Override
    public boolean isFixedWidth() {
        return true;
    }

    @Override
    public Integer getByteSize() {
        return Bytes.SIZEOF_BYTE;
    }

    @Override
    public Integer getMaxLength(Object o) {
        return BYTE_PRECISION;
    }

    @Override
    public byte[] toBytes(Object object) {
        byte[] b = new byte[Bytes.SIZEOF_BYTE];
        toBytes(object, b, 0);
        return b;
    }

    @Override
    public int toBytes(Object object, byte[] bytes, int offset) {
        if (object == null) {
            throw newIllegalDataException(this + " may not be null");
        }
        return this.getCodec().encodeByte(((Number) object).byteValue(), bytes, offset);
    }

    @Override
    public Object toObject(String value) {

        try {
            Byte b = Byte.parseByte(value);
            if (b.byteValue() < 0) {
                throw newIllegalDataException("Value may not be negative(" + b + ")");
            }
            return b;
        } catch (NumberFormatException e) {
            throw newIllegalDataException(e);
        }
    }

    @Override
    public Object toObject(Object object, PDataType actualType) {
        Byte v = (Byte) PTinyint.INSTANCE.toObject(object, actualType);
        throwIfNonNegativeNumber(v);
        return v;
    }

    @Override
    public Object toObject(byte[] b, int o, int l, PDataType actualType, SortOrder sortOrder, Integer maxLength, Integer scale) {
        Byte v = (Byte) PTinyint.INSTANCE.toObject(b, o, l, actualType, sortOrder);
        throwIfNonNegativeNumber(v);
        return v;
    }

    @Override
    public boolean isCoercibleTo(PDataType targetType) {
        return targetType.equals(this) || PUnsignedSmallint.INSTANCE.isCoercibleTo(targetType) || PTinyint.INSTANCE.isCoercibleTo(targetType);
    }

    @Override
    public boolean isCoercibleTo(PDataType targetType, Object value) {
        return super.isCoercibleTo(targetType, value) || PTinyint.INSTANCE.isCoercibleTo(targetType, value);
    }

    @Override
    public boolean isComparableTo(PDataType targetType) {
        return PDecimal.INSTANCE.isComparableTo(targetType);
    }

    @Override
    public int getResultSetSqlType() {
        return PTinyint.INSTANCE.getResultSetSqlType();
    }

    @Override
    public Object getSampleValue(Integer maxLength, Integer arrayLength) {
        return ((Integer) RANDOM.get().nextInt(Byte.MAX_VALUE)).byteValue();
    }

    static class UnsignedByteCodec extends PTinyint.ByteCodec {

        @Override
        public byte decodeByte(byte[] b, int o, SortOrder sortOrder) {
            Preconditions.checkNotNull(sortOrder);
            checkForSufficientLength(b, o, Bytes.SIZEOF_BYTE);
            byte v = b[o];
            if (sortOrder == SortOrder.DESC) {
                v = SortOrder.invert(v);
            }
            if (v < 0) {
                throw newIllegalDataException();
            }
            return v;
        }

        @Override
        public int encodeByte(byte v, byte[] b, int o) {
            if (v < 0) {
                throw newIllegalDataException();
            }
            Bytes.putByte(b, o, v);
            return Bytes.SIZEOF_BYTE;
        }
    }
}


try {
            Byte b = Byte.parseByte(value);
            if (b.byteValue() < 0) {
                throw newIllegalDataException("Value may not be negative(" + b + ")");
            }
            return b;
        } catch (NumberFormatException e) {
            throw newIllegalDataException(e);
        }

package org.apache.phoenix.schema.types;

import org.apache.hadoop.hbase.util.Bytes;
import org.apache.phoenix.schema.SortOrder;
import org.apache.phoenix.thirdparty.com.google.common.base.Preconditions;

public class PUnsignedTinyint extends PWholeNumber<Byte> {

    public static final PUnsignedTinyint INSTANCE = new PUnsignedTinyint();

    private PUnsignedTinyint() {
        super("UNSIGNED_TINYINT", 11, Byte.class, new UnsignedByteCodec(), 18);
    }

    @Override
    public Integer getScale(Object o) {
        return ZERO;
    }

    @Override
    public int compareTo(Object lhs, Object rhs, PDataType rhsType) {
        return PLong.INSTANCE.compareTo(lhs, rhs, rhsType);
    }

    @Override
    public boolean isFixedWidth() {
        return true;
    }

    @Override
    public Integer getByteSize() {
        return Bytes.SIZEOF_BYTE;
    }

    @Override
    public Integer getMaxLength(Object o) {
        return BYTE_PRECISION;
    }

    @Override
    public byte[] toBytes(Object object) {
        byte[] b = new byte[Bytes.SIZEOF_BYTE];
        toBytes(object, b, 0);
        return b;
    }

    @Override
    public int toBytes(Object object, byte[] bytes, int offset) {
        if (object == null) {
            throw newIllegalDataException(this + " may not be null");
        }
        return this.getCodec().encodeByte(((Number) object).byteValue(), bytes, offset);
    }

    @Override
    public Object toObject(String value) {
        if (value == null || value.length() == 0) {
            return null;
        }

    }

    @Override
    public Object toObject(Object object, PDataType actualType) {
        Byte v = (Byte) PTinyint.INSTANCE.toObject(object, actualType);
        throwIfNonNegativeNumber(v);
        return v;
    }

    @Override
    public Object toObject(byte[] b, int o, int l, PDataType actualType, SortOrder sortOrder, Integer maxLength, Integer scale) {
        Byte v = (Byte) PTinyint.INSTANCE.toObject(b, o, l, actualType, sortOrder);
        throwIfNonNegativeNumber(v);
        return v;
    }

    @Override
    public boolean isCoercibleTo(PDataType targetType) {
        return targetType.equals(this) || PUnsignedSmallint.INSTANCE.isCoercibleTo(targetType) || PTinyint.INSTANCE.isCoercibleTo(targetType);
    }

    @Override
    public boolean isCoercibleTo(PDataType targetType, Object value) {
        return super.isCoercibleTo(targetType, value) || PTinyint.INSTANCE.isCoercibleTo(targetType, value);
    }

    @Override
    public boolean isComparableTo(PDataType targetType) {
        return PDecimal.INSTANCE.isComparableTo(targetType);
    }

    @Override
    public int getResultSetSqlType() {
        return PTinyint.INSTANCE.getResultSetSqlType();
    }

    @Override
    public Object getSampleValue(Integer maxLength, Integer arrayLength) {
        return ((Integer) RANDOM.get().nextInt(Byte.MAX_VALUE)).byteValue();
    }

    static class UnsignedByteCodec extends PTinyint.ByteCodec {

        @Override
        public byte decodeByte(byte[] b, int o, SortOrder sortOrder) {
            Preconditions.checkNotNull(sortOrder);
            checkForSufficientLength(b, o, Bytes.SIZEOF_BYTE);
            byte v = b[o];
            if (sortOrder == SortOrder.DESC) {
                v = SortOrder.invert(v);
            }
            if (v < 0) {
                throw newIllegalDataException();
            }
            return v;
        }

        @Override
        public int encodeByte(byte v, byte[] b, int o) {
            if (v < 0) {
                throw newIllegalDataException();
            }
            Bytes.putByte(b, o, v);
            return Bytes.SIZEOF_BYTE;
        }
    }
}


package org.apache.phoenix.schema.types;

import org.apache.hadoop.hbase.util.Bytes;
import org.apache.phoenix.schema.SortOrder;
import org.apache.phoenix.thirdparty.com.google.common.base.Preconditions;

public class PUnsignedTinyint extends PWholeNumber<Byte> {

    public static final PUnsignedTinyint INSTANCE = new PUnsignedTinyint();

    private PUnsignedTinyint() {
        super("UNSIGNED_TINYINT", 11, Byte.class, new UnsignedByteCodec(), 18);
    }

    @Override
    public Integer getScale(Object o) {
        return ZERO;
    }

    @Override
    public int compareTo(Object lhs, Object rhs, PDataType rhsType) {
        return PLong.INSTANCE.compareTo(lhs, rhs, rhsType);
    }

    @Override
    public boolean isFixedWidth() {
        return true;
    }

    @Override
    public Integer getByteSize() {
        return Bytes.SIZEOF_BYTE;
    }

    @Override
    public Integer getMaxLength(Object o) {
        return BYTE_PRECISION;
    }

    @Override
    public byte[] toBytes(Object object) {
        byte[] b = new byte[Bytes.SIZEOF_BYTE];
        toBytes(object, b, 0);
        return b;
    }

    @Override
    public int toBytes(Object object, byte[] bytes, int offset) {
        if (object == null) {
            throw newIllegalDataException(this + " may not be null");
        }
        return this.getCodec().encodeByte(((Number) object).byteValue(), bytes, offset);
    }

    @Override
    public Object toObject(String value) {
        if (value == null || value.length() == 0) {
            return null;
        }
        try {
            Byte b = Byte.parseByte(value);
            if (b.byteValue() < 0) {
                throw newIllegalDataException("Value may not be negative(" + b + ")");
            }
            return b;
        } catch (NumberFormatException e) {
            throw newIllegalDataException(e);
        }

    @Override
    public Object toObject(Object object, PDataType actualType) {
        Byte v = (Byte) PTinyint.INSTANCE.toObject(object, actualType);
        throwIfNonNegativeNumber(v);
        return v;
    }

    @Override
    public Object toObject(byte[] b, int o, int l, PDataType actualType, SortOrder sortOrder, Integer maxLength, Integer scale) {
        Byte v = (Byte) PTinyint.INSTANCE.toObject(b, o, l, actualType, sortOrder);
        throwIfNonNegativeNumber(v);
        return v;
    }

    @Override
    public boolean isCoercibleTo(PDataType targetType) {
        return targetType.equals(this) || PUnsignedSmallint.INSTANCE.isCoercibleTo(targetType) || PTinyint.INSTANCE.isCoercibleTo(targetType);
    }

    @Override
    public boolean isCoercibleTo(PDataType targetType, Object value) {
        return super.isCoercibleTo(targetType, value) || PTinyint.INSTANCE.isCoercibleTo(targetType, value);
    }

    @Override
    public boolean isComparableTo(PDataType targetType) {
        return PDecimal.INSTANCE.isComparableTo(targetType);
    }

    @Override
    public int getResultSetSqlType() {
        return PTinyint.INSTANCE.getResultSetSqlType();
    }

    @Override
    public Object getSampleValue(Integer maxLength, Integer arrayLength) {
        return ((Integer) RANDOM.get().nextInt(Byte.MAX_VALUE)).byteValue();
    }

    static class UnsignedByteCodec extends PTinyint.ByteCodec {

        @Override
        public byte decodeByte(byte[] b, int o, SortOrder sortOrder) {
            Preconditions.checkNotNull(sortOrder);
            checkForSufficientLength(b, o, Bytes.SIZEOF_BYTE);
            byte v = b[o];
            if (sortOrder == SortOrder.DESC) {
                v = SortOrder.invert(v);
            }
            if (v < 0) {
                throw newIllegalDataException();
            }
            return v;
        }

        @Override
        public int encodeByte(byte v, byte[] b, int o) {
            if (v < 0) {
                throw newIllegalDataException();
            }
            Bytes.putByte(b, o, v);
            return Bytes.SIZEOF_BYTE;
        }
    }
}


package org.apache.phoenix.schema.types;

import org.apache.hadoop.hbase.util.Bytes;
import org.apache.phoenix.schema.SortOrder;
import org.apache.phoenix.thirdparty.com.google.common.base.Preconditions;

public class PUnsignedTinyint extends PWholeNumber<Byte> {

    public static final PUnsignedTinyint INSTANCE = new PUnsignedTinyint();

    private PUnsignedTinyint() {
        super("UNSIGNED_TINYINT", 11, Byte.class, new UnsignedByteCodec(), 18);
    }

    @Override
    public Integer getScale(Object o) {
        return ZERO;
    }

    @Override
    public int compareTo(Object lhs, Object rhs, PDataType rhsType) {
        return PLong.INSTANCE.compareTo(lhs, rhs, rhsType);
    }

    @Override
    public boolean isFixedWidth() {
        return true;
    }

    @Override
    public Integer getByteSize() {
        return Bytes.SIZEOF_BYTE;
    }

    @Override
    public Integer getMaxLength(Object o) {
        return BYTE_PRECISION;
    }

    @Override
    public byte[] toBytes(Object object) {
        byte[] b = new byte[Bytes.SIZEOF_BYTE];
        toBytes(object, b, 0);
        return b;
    }

    @Override
    public int toBytes(Object object, byte[] bytes, int offset) {
        if (object == null) {
            throw newIllegalDataException(this + " may not be null");
        }
        return this.getCodec().encodeByte(((Number) object).byteValue(), bytes, offset);
    }

    @Override
    public Object toObject(String value) {
        if (value == null || value.length() == 0) {
            return null;
        }
        try {
            Byte b = Byte.parseByte(value);
            if (b.byteValue() < 0) {
                throw newIllegalDataException("Value may not be negative(" + b + ")");
            }
            return b;
        } catch (NumberFormatException e) {
            throw newIllegalDataException(e);
        }
    }

    @Override
    public Object toObject(Object object, PDataType actualType) {
        Byte v = (Byte) PTinyint.INSTANCE.toObject(object, actualType);
        throwIfNonNegativeNumber(v);
        return v;
    }

    @Override
    public Object toObject(byte[] b, int o, int l, PDataType actualType, SortOrder sortOrder, Integer maxLength, Integer scale) {
        Byte v = (Byte) PTinyint.INSTANCE.toObject(b, o, l, actualType, sortOrder);
        throwIfNonNegativeNumber(v);
        return v;
    }

    @Override
    public boolean isCoercibleTo(PDataType targetType) {
        return targetType.equals(this) || PUnsignedSmallint.INSTANCE.isCoercibleTo(targetType) || PTinyint.INSTANCE.isCoercibleTo(targetType);
    }

    @Override
    public boolean isCoercibleTo(PDataType targetType, Object value) {
        return super.isCoercibleTo(targetType, value) || PTinyint.INSTANCE.isCoercibleTo(targetType, value);
    }

    @Override
    public boolean isComparableTo(PDataType targetType) {
        return PDecimal.INSTANCE.isComparableTo(targetType);
    }

    @Override
    public int getResultSetSqlType() {
        return PTinyint.INSTANCE.getResultSetSqlType();
    }

    @Override
    public Object getSampleValue(Integer maxLength, Integer arrayLength) {
        return ((Integer) RANDOM.get().nextInt(Byte.MAX_VALUE)).byteValue();
    }

    static class UnsignedByteCodec extends PTinyint.ByteCodec {

        @Override
        public byte decodeByte(byte[] b, int o, SortOrder sortOrder) {
            Preconditions.checkNotNull(sortOrder);
            checkForSufficientLength(b, o, Bytes.SIZEOF_BYTE);
            byte v = b[o];
            if (sortOrder == SortOrder.DESC) {
                v = SortOrder.invert(v);
            }
            if (v < 0) {
                throw newIllegalDataException();
            }
            return v;
        }

        @Override
        public int encodeByte(byte v, byte[] b, int o) {
            if (v < 0) {
                throw newIllegalDataException();
            }
            Bytes.putByte(b, o, v);
            return Bytes.SIZEOF_BYTE


if (object == null) {
            throw newIllegalDataException(this + " may not be null");
        }

package org.apache.phoenix.schema.types;

import org.apache.hadoop.hbase.util.Bytes;
import org.apache.phoenix.schema.SortOrder;
import org.apache.phoenix.thirdparty.com.google.common.base.Preconditions;

public class PUnsignedTinyint extends PWholeNumber<Byte> {

    public static final PUnsignedTinyint INSTANCE = new PUnsignedTinyint();

    private PUnsignedTinyint() {
        super("UNSIGNED_TINYINT", 11, Byte.class, new UnsignedByteCodec(), 18);
    }

    @Override
    public Integer getScale(Object o) {
        return ZERO;
    }

    @Override
    public int compareTo(Object lhs, Object rhs, PDataType rhsType) {
        return PLong.INSTANCE.compareTo(lhs, rhs, rhsType);
    }

    @Override
    public boolean isFixedWidth() {
        return true;
    }

    @Override
    public Integer getByteSize() {
        return Bytes.SIZEOF_BYTE;
    }

    @Override
    public Integer getMaxLength(Object o) {
        return BYTE_PRECISION;
    }

    @Override
    public byte[] toBytes(Object object) {
        byte[] b = new byte[Bytes.SIZEOF_BYTE];
        toBytes(object, b, 0);
        return b;
    }

    @Override
    public int toBytes(Object object, byte[] bytes, int offset) {

        return this.getCodec().encodeByte(((Number) object).byteValue(), bytes, offset);
    }

    @Override
    public Object toObject(String value) {
        if (value == null || value.length() == 0) {
            return null;
        }
        try {
            Byte b = Byte.parseByte(value);
            if (b.byteValue() < 0) {
                throw newIllegalDataException("Value may not be negative(" + b + ")");
            }
            return b;
        } catch (NumberFormatException e) {
            throw newIllegalDataException(e);
        }
    }

    @Override
    public Object toObject(Object object, PDataType actualType) {
        Byte v = (Byte) PTinyint.INSTANCE.toObject(object, actualType);
        throwIfNonNegativeNumber(v);
        return v;
    }

    @Override
    public Object toObject(byte[] b, int o, int l, PDataType actualType, SortOrder sortOrder, Integer maxLength, Integer scale) {
        Byte v = (Byte) PTinyint.INSTANCE.toObject(b, o, l, actualType, sortOrder);
        throwIfNonNegativeNumber(v);
        return v;
    }

    @Override
    public boolean isCoercibleTo(PDataType targetType) {
        return targetType.equals(this) || PUnsignedSmallint.INSTANCE.isCoercibleTo(targetType) || PTinyint.INSTANCE.isCoercibleTo(targetType);
    }

    @Override
    public boolean isCoercibleTo(PDataType targetType, Object value) {
        return super.isCoercibleTo(targetType, value) || PTinyint.INSTANCE.isCoercibleTo(targetType, value);
    }

    @Override
    public boolean isComparableTo(PDataType targetType) {
        return PDecimal.INSTANCE.isComparableTo(targetType);
    }

    @Override
    public int getResultSetSqlType() {
        return PTinyint.INSTANCE.getResultSetSqlType();
    }

    @Override
    public Object getSampleValue(Integer maxLength, Integer arrayLength) {
        return ((Integer) RANDOM.get().nextInt(Byte.MAX_VALUE)).byteValue();
    }

    static class UnsignedByteCodec extends PTinyint.ByteCodec {

        @Override
        public byte decodeByte(byte[] b, int o, SortOrder sortOrder) {
            Preconditions.checkNotNull(sortOrder);
            checkForSufficientLength(b, o, Bytes.SIZEOF_BYTE);
            byte v = b[o];
            if (sortOrder == SortOrder.DESC) {
                v = SortOrder.invert(v);
            }
            if (v < 0) {
                throw newIllegalDataException();
            }
            return v;
        }

        @Override
        public int encodeByte(byte v, byte[] b, int o) {
            if (v < 0) {
                throw newIllegalDataException();
            }
            Bytes.putByte(b, o, v);
            return Bytes.SIZEOF_BYTE;
        }
    }
}


/*
 * JBoss, Home of Professional Open Source
 * full listing of individual contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://example.com
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jboss.weld.contexts;

import org.jboss.weld.contexts.beanstore.BeanStore;

/**
 * Base class for contexts using a thread local to store a bound bean context
 *
 * @author Pete Muir
 */
public abstract class AbstractUnboundContext extends AbstractManagedContext {

    private final ThreadLocal<BeanStore> beanStore;

    public AbstractUnboundContext(String contextId, boolean multithreaded) {
        super(contextId, multithreaded);
        this.beanStore = new ThreadLocal<BeanStore>();
    }

    /**
     * Gets the bean store
     *
     * @returns The bean store
     */

{
        return beanStore.get();
    }

    /**
     * Sets the bean store
     *
     * @param beanStore The bean store
     */
    protected void setBeanStore(BeanStore beanStore) {
        this.beanStore.set(beanStore);
    }

    @Override
    protected void destroy() {
        super.destroy();
        this.beanStore.remove();
    }

    @Override
    public void cleanup() {
        super.cleanup();
        beanStore.remove();
    }
}


{
        this.beanStore.set(beanStore);
    }

/*
 * JBoss, Home of Professional Open Source
 * full listing of individual contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://example.com
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jboss.weld.contexts;

import org.jboss.weld.contexts.beanstore.BeanStore;

/**
 * Base class for contexts using a thread local to store a bound bean context
 *
 * @author Pete Muir
 */
public abstract class AbstractUnboundContext extends AbstractManagedContext {

    private final ThreadLocal<BeanStore> beanStore;

    public AbstractUnboundContext(String contextId, boolean multithreaded) {
        super(contextId, multithreaded);
        this.beanStore = new ThreadLocal<BeanStore>();
    }

    /**
     * Gets the bean store
     *
     * @returns The bean store
     */
    protected BeanStore getBeanStore() {
        return beanStore.get();
    }

    /**
     * Sets the bean store
     *
     * @param beanStore The bean store
     */
    protected void setBeanStore(BeanStore beanStore)

    @Override
    protected void destroy() {
        super.destroy();
        this.beanStore.remove();
    }

    @Override
    public void cleanup() {
        super.cleanup();
        beanStore.remove();
    }
}


/*
 * JBoss, Home of Professional Open Source
 * full listing of individual contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://example.com
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jboss.weld.contexts;

import org.jboss.weld.contexts.beanstore.BeanStore;

/**
 * Base class for contexts using a thread local to store a bound bean context
 *
 * @author Pete Muir
 */
public abstract class AbstractUnboundContext extends AbstractManagedContext {

    private final ThreadLocal<BeanStore> beanStore;

    public AbstractUnboundContext(String contextId, boolean multithreaded) {
        super(contextId, multithreaded);
        this.beanStore = new ThreadLocal<BeanStore>();
    }

    /**
     * Gets the bean store
     *
     * @returns The bean store
     */
    protected BeanStore getBeanStore() {
        return beanStore.get();
    }

    /**
     * Sets the bean store
     *
     * @param beanStore The bean store
     */
    protected void setBeanStore(BeanStore beanStore) {
        this.beanStore.set(beanStore);
    }

    @Override
    protected void destroy() {
        super.destroy();
        this.beanStore.remove();
    }

    @Override
    public void cleanup() {
        super.c


protected void setBeanStore(BeanStore beanStore) {
        this.beanStore.set(beanStore);
    }

/*
 * JBoss, Home of Professional Open Source
 * full listing of individual contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://example.com
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jboss.weld.contexts;

import org.jboss.weld.contexts.beanstore.BeanStore;

/**
 * Base class for contexts using a thread local to store a bound bean context
 *
 * @author Pete Muir
 */
public abstract class AbstractUnboundContext extends AbstractManagedContext {

    private final ThreadLocal<BeanStore> beanStore;

    public AbstractUnboundContext(String contextId, boolean multithreaded) {
        super(contextId, multithreaded);
        this.beanStore = new ThreadLocal<BeanStore>();
    }

    /**
     * Gets the bean store
     *
     * @returns The bean store
     */
    protected BeanStore getBeanStore() {
        return beanStore.get();
    }

    /**
     * Sets the bean store
     *
     * @param beanStore The bean store
     */


@Override
    public String getServerInfo()

package org.ops4j.pax.web.service.spi.servlet;

import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Enumeration;
import java.util.EventListener;
import java.util.Map;
import java.util.Set;
import javax.servlet.Filter;
import javax.servlet.FilterRegistration;
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
import javax.servlet.SessionCookieConfig;
import javax.servlet.SessionTrackingMode;
import javax.servlet.descriptor.JspConfigDescriptor;
import org.ops4j.pax.web.service.WebContainerContext;
import org.ops4j.pax.web.service.spi.model.OsgiContextModel;
import org.osgi.framework.Bundle;
import org.osgi.framework.wiring.BundleWiring;

/**
 *
This class provides special {@link ServletContext#getClassLoader()} method for Whiteboard elements.
 * All Whiteboard services should use a {@link ServletContext} which uses single
 * {@link org.osgi.service.http.HttpContext} or {@link org.osgi.service.http.context.ServletContextHelper}, but
 * additionally, class loader should come from the bundle which registered the Whiteboard service (e.g., a servlet)
 * itself, not from the bundle that has registered the {@link org.osgi.service.http.context.ServletContextHelper}.

 */
public class OsgiScopedServletContext implements ServletContext {

    /**
     * {@link org.ops4j.pax.web.service.spi.servlet.OsgiServletContext} to which the target servlet is registered.
     * Servlet itself can be registered in the scope of different {@link Bundle}, so actual
     * {@link org.ops4j.pax.web.service.WebContainerContext} has to be obtained/resolved within the scope of proper
     * {@link Bundle}.
     */
    private final OsgiServletContext osgiContext;

    /**
     * {@link Bundle} which was used to register target {@link javax.servlet.Servlet}
     */
    private final Bundle bundle;

    private final WebContainerContext webContainerContext;

    public OsgiScopedServletContext(OsgiServletContext osgiContext, Bundle bundle) {
        this.osgiContext = osgiContext;
        this.bundle = bundle;
        this.webContainerContext = osgiContext.getOsgiContextModel().resolveHttpContext(bundle);
    }

    public OsgiServletContext getOsgiContext() {
        return osgiContext;
    }

    public OsgiContextModel getOsgiContextModel() {
        return osgiContext.getOsgiContextModel();
    }

    public ServletContext getContainerServletContext() {
        return osgiContext.getContainerServletContext();
    }

    public ClassLoader getOsgiContextClassLoader() {
        return osgiContext.getClassLoader();
    }

    public String[] getWelcomeFiles() {
        return osgiContext.getWelcomeFiles();
    }

    public boolean isWelcomeFilesRedirect() {
        return osgiContext.isWelcomeFilesRedirect();
    }

    @Override
    public FilterRegistration.Dynamic addFilter(String filterName, String className) {
        throw new UnsupportedOperationException("addFilter() is not supported.");
    }

    @Override
    public FilterRegistration.Dynamic addFilter(String filterName, Filter filter) {
        throw new UnsupportedOperationException("addFilter() is not supported.");
    }

    @Override
    public FilterRegistration.Dynamic addFilter(String filterName, Class<? extends Filter> filterClass) {
        throw new UnsupportedOperationException("addFilter() is not supported.");
    }

    @Override
    public void addListener(String className) {
        throw new UnsupportedOperationException("addListener() is not supported.");
    }

    @Override
    public <T extends EventListener> void addListener(T t) {
        throw new UnsupportedOperationException("addListener() is not supported.");
    }

    @Override
    public void addListener(Class<? extends EventListener> listenerClass) {
        throw new UnsupportedOperationException("addListener() is not supported.");
    }

    @Override
    public ServletRegistration.Dynamic addServlet(String servletName, String className) {
        throw new UnsupportedOperationException("addServlet() is not supported.");
    }

    @Override
    public ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet) {
        throw new UnsupportedOperationException("addServlet() is not supported.");
    }

    @Override
    public ServletRegistration.Dynamic addServlet(String servletName, Class<? extends Servlet> servletClass) {
        throw new UnsupportedOperationException("addServlet() is not supported.");
    }

    @Override
    public <T extends Filter> T createFilter(Class<T> clazz) throws ServletException {
        throw new UnsupportedOperationException("createFilter() is not supported.");
    }

    @Override
    public <T extends EventListener> T createListener(Class<T> clazz) throws ServletException {
        throw new UnsupportedOperationException("createListener() is not supported.");
    }

    @Override
    public <T extends Servlet> T createServlet(Class<T> clazz) throws ServletException {
        throw new UnsupportedOperationException("createServlet() is not supported.");
    }

    @Override
    public void declareRoles(String... roleNames) {
        throw new UnsupportedOperationException("declareRoles() is not supported.");
    }

    @Override
    public boolean setInitParameter(String name, String value) {
        throw new UnsupportedOperationException("setInitParameter() is not supported.");
    }

    @Override
    public void setSessionTrackingModes(Set<SessionTrackingMode> sessionTrackingModes) {
        throw new UnsupportedOperationException("setSessionTrackingModes() is not supported.");
    }

    @Override
    public ServletRegistration.Dynamic addJspFile(String servletName, String jspFile) {
        throw new UnsupportedOperationException("addJspFile() is not supported.");
    }

    // --- methods that are scoped to HttpContext/ServletContextHelper
    @Override
    public Object getAttribute(String name) {
        return osgiContext.getAttribute(name);
    }

    @Override
    public Enumeration<String> getAttributeNames() {
        return osgiContext.getAttributeNames();
    }

    @Override
    public void setAttribute(String name, Object object) {
        osgiContext.setAttribute(name, object);
    }

    @Override
    public void removeAttribute(String name) {
        osgiContext.removeAttribute(name);
    }

    // --- methods simply delegating to server-specific ServletContext. Backed by the Servlet Container.
    @Override
    public String getContextPath() {
        return osgiContext.getContextPath();
    }

    @Override
    public ServletContext getContext(String uripath) {
        return osgiContext.getContext(uripath);
    }

    @Override
    public Set<SessionTrackingMode> getDefaultSessionTrackingModes() {
        return osgiContext.getDefaultSessionTrackingModes();
    }

    @Override
    public int getEffectiveMajorVersion() {
        return osgiContext.getEffectiveMajorVersion();
    }

    @Override
    public int getEffectiveMinorVersion() {
        return osgiContext.getEffectiveMinorVersion();
    }

    @Override
    public Set<SessionTrackingMode> getEffectiveSessionTrackingModes() {
        return osgiContext.getEffectiveSessionTrackingModes();
    }

    @Override
    public FilterRegistration getFilterRegistration(String filterName) {
        return osgiContext.getFilterRegistration(filterName);
    }

    @Override
    public Map<String, ? extends FilterRegistration> getFilterRegistrations() {
        return osgiContext.getFilterRegistrations();
    }

    @Override
    public int getMajorVersion() {
        return osgiContext.getMajorVersion();
    }

    @Override
    public int getMinorVersion() {
        return osgiContext.getMinorVersion();
    }

    @Override
    @SuppressWarnings({ "deprecation", "RedundantSuppression" })
    public Servlet getServlet(String name) throws ServletException {
        return osgiContext.getServlet(name);
    }

    @Override
    @SuppressWarnings({ "deprecation", "RedundantSuppression" })
    public Enumeration<String> getServletNames() {
        return osgiContext.getServletNames();
    }

    @Override
    public ServletRegistration getServletRegistration(String servletName) {
        return osgiContext.getServletRegistration(servletName);
    }

    @Override
    public Map<String, ? extends ServletRegistration> getServletRegistrations() {
        return osgiContext.getServletRegistrations();
    }

    @Override
    @SuppressWarnings({ "deprecation", "RedundantSuppression" })
    public Enumeration<Servlet> getServlets() {
        return osgiContext.getServlets();
    }

    @Override
    public String getVirtualServerName() {
        return osgiContext.getVirtualServerName();
    }

{
        return osgiContext.getServerInfo();
    }

    @Override
    public void log(String msg) {
        osgiContext.log(msg);
    }

    @Override
    @SuppressWarnings({ "deprecation", "RedundantSuppression" })
    public void log(Exception exception, String msg) {
        osgiContext.log(exception, msg);
    }

    @Override
    public void log(String message, Throwable throwable) {
        osgiContext.log(message, throwable);
    }

    @Override
    public SessionCookieConfig getSessionCookieConfig() {
        return osgiContext.getSessionCookieConfig();
    }

    @Override
    public JspConfigDescriptor getJspConfigDescriptor() {
        return osgiContext.getJspConfigDescriptor();
    }

    // --- methods also delegating to server-specific ServletContext, but added in Servlet spec 4.0
    @Override
    public int getSessionTimeout() {
        return osgiContext.getSessionTimeout();
    }

    @Override
    public void setSessionTimeout(int sessionTimeout) {
        osgiContext.setSessionTimeout(sessionTimeout);
    }

    @Override
    public String getRequestCharacterEncoding() {
        return osgiContext.getRequestCharacterEncoding();
    }

    @Override
    public void setRequestCharacterEncoding(String encoding) {
        osgiContext.setRequestCharacterEncoding(encoding);
    }

    @Override
    public String getResponseCharacterEncoding() {
        return osgiContext.getResponseCharacterEncoding();
    }

    @Override
    public void setResponseCharacterEncoding(String encoding) {
        osgiContext.setResponseCharacterEncoding(encoding);
    }

    // --- methods backed by the ServletContextHelper.
    // some of them, that delegate to WebContainerContext have to use proper WebContainerContext - from
    // the bundle that was used to register the servlet, not from the bundle that registered target
    // HttpContext/ServletContextHelper
    @Override
    public String getMimeType(String file) {
        return osgiContext.getMimeType(webContainerContext, file);
    }

    @Override
    public String getRealPath(String path) {
        return osgiContext.getRealPath(webContainerContext, path);
    }

    @Override
    public URL getResource(String path) throws MalformedURLException {
        return osgiContext.getResource(webContainerContext, path);
    }

    @Override
    public InputStream getResourceAsStream(String path) {
        return osgiContext.getResourceAsStream(webContainerContext, path);
    }

    @Override
    public Set<String> getResourcePaths(String path) {
        return osgiContext.getResourcePaths(webContainerContext, path);
    }

    // --- methods backed by the OsgiContextModel (object "customized" by trackers from ServletContextHelper)
    @Override
    public String getInitParameter(String name) {
        return osgiContext.getInitParameter(name);
    }

    @Override
    public Enumeration<String> getInitParameterNames() {
        return osgiContext.getInitParameterNames();
    }

    @Override
    public RequestDispatcher getRequestDispatcher(String path) {
        return osgiContext.getRequestDispatcher(path);
    }

    @Override
    public RequestDispatcher getNamedDispatcher(String name) {
        return osgiContext.getNamedDispatcher(name);
    }

    @Override
    public String getServletContextName() {
        return osgiContext.getServletContextName();
    }

    // --- methods dependent on which actual servlet/filter uses the context
    @Override
    public ClassLoader getClassLoader() {
        // according to Whiteboard specification - this should be strictly a classloader of a bundle registering
        // the servlet/filter, but in case of WAB, we'll return the WAB's classloader (delegating to
        // all reachable bundles)
        if (getOsgiContextModel().isWab()) {
            return getOsgiContextModel().getClassLoader();
        }
        return bundle.adapt(BundleWiring.class).getClassLoader();
    }
}