package org.allmyinfo.operation.core;

import org.allmyinfo.operation.BaseOperationImpl;
import org.allmyinfo.operation.ExecutionContext;
import org.allmyinfo.operation.PathElement;
import org.eclipse.jdt.annotation.NonNull;

public final class LiteralFloat4 extends BaseOperationImpl {
	public static final @NonNull String OPERATION = "literalFloat4";
	public static final @NonNull String OPERAND_VALUE = "value";
	public final @NonNull Float value;

	public LiteralFloat4(final @NonNull Float value) {
		this.value = value;
	}

	@Override
	public @NonNull Object execute(final @NonNull PathElement parentPathElement,
			final @NonNull ExecutionContext context) {
		return value;
	}

	@Override
	public String toString() {
		return value.toString();
	}

	@Override
	public @NonNull Class<?> returns() {
		return Float.class;
	}

	@Override
	public boolean canReturnNull() {
		return false;
	}

	@Override
	public @NonNull String getName() {
		return OPERATION;
	}
}