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

net.kut3.Result Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2019 Kut3Net.
 *
 * 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://www.apache.org/licenses/LICENSE-2.0
 *
 * 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 net.kut3;

import net.kut3.json.JsonObject;

/**
 *
 */
public interface Result {

    public static final String ERR_DESC = "ed";
    public static final String START_TIME = "st";
    public static final String END_TIME = "et";
    public static final String DURATION = "d";

    /**
     * For asynchronous operation only, all synchronous operations should always
     * return true.
     *
     * @return true or false
     */
    boolean isCompleted();

    /**
     * Should overridden by the successor
     *
     * @return true or false
     */
    boolean isSuccess();

    /**
     * Set the error description
     *
     * @param errDesc Error description
     */
    void errDesc(String errDesc);

    /**
     *
     */
    void complete();

    /**
     * For logging only
     *
     * @return A {@link JsonObject} instance represents this object
     */
    JsonObject toJsonObj();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy