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

com.scalar.dl.ledger.contract.StringBasedContract Maven / Gradle / Ivy

There is a newer version: 3.10.0
Show newest version
package com.scalar.dl.ledger.contract;

import com.scalar.dl.ledger.statemachine.Ledger;
import javax.annotation.Nullable;

/**
 * A base contract using the internal String representation as it is for the Ledger data, invoke
 * method arguments, and invoke method return type. You can create your contracts based on it. It is
 * recommended to use {@link JacksonBasedContract} in most cases, but you can use this class to
 * achieve faster and more efficient contract execution by avoiding JSON serialization and
 * deserialization.
 *
 * @author Hiroyuki Yamada
 */
public abstract class StringBasedContract extends ContractBase {

  @Override
  String deserialize(@Nullable String string) {
    return string;
  }

  @Override
  @Nullable
  final String invokeRoot(Ledger ledger, String argument, String properties) {
    return invoke(ledger, argument, properties);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy