001 /* 002 @license.text@ 003 */ 004 package biz.hammurapi.eval; 005 006 import biz.hammurapi.convert.CompositeConverter; 007 008 009 public class SingleResult extends Result { 010 Object value; 011 private CompositeConverter converter; 012 013 /** 014 * @param value 015 * @param type 016 * @param evaluator TODO 017 */ 018 public SingleResult(CompositeConverter converter, Class type, Object value) { 019 super(type); 020 this.converter=converter; 021 this.value = value; 022 } 023 024 public Object getValue() { 025 return type==null ? value : this.converter.convert(value, type, false); 026 } 027 028 void setValue(Object value) { 029 this.value = value; 030 } 031 }