| 1 | package com.hammurapi.eventbus.tests; |
| 2 | |
| 3 | import java.io.ObjectInputStream; |
| 4 | import java.util.List; |
| 5 | import java.util.Map; |
| 6 | |
| 7 | import com.hammurapi.extract.CompiledExtractorBase; |
| 8 | import com.hammurapi.extract.Extractor; |
| 9 | import com.hammurapi.extract.Predicate; |
| 10 | |
| 11 | @SuppressWarnings("unchecked") |
| 12 | class Extractor19 extends CompiledExtractorBase<java.lang.Object, java.lang.Object, java.lang.Object> { |
| 13 | |
| 14 | /** |
| 15 | * Class identity for comparison with other classes. |
| 16 | */ |
| 17 | private static final List<Object> IDENTITY; |
| 18 | |
| 19 | static { |
| 20 | try { |
| 21 | ObjectInputStream ois = new ObjectInputStream(Extractor19.class.getResourceAsStream("Extractor19.identity")); |
| 22 | try { |
| 23 | IDENTITY = (List<Object>) ois.readObject(); |
| 24 | } finally { |
| 25 | ois.close(); |
| 26 | } |
| 27 | } catch (Exception e) { |
| 28 | throw new ExceptionInInitializerError(e); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | Extractor19(int[] map) { |
| 33 | super(map, false, 0); |
| 34 | } |
| 35 | |
| 36 | @Override |
| 37 | protected java.lang.Object extractInternal(java.lang.Object eCtx, Map<java.lang.Object, Map<Extractor<java.lang.Object, ? super java.lang.Object, java.lang.Object>, ? super java.lang.Object>> cache, java.lang.Object... obj) { |
| 38 | |
| 39 | java.lang.String hello = (java.lang.String) obj[mapArg(0)]; |
| 40 | |
| 41 | return (int) hello.charAt(0); |
| 42 | } |
| 43 | |
| 44 | @Override |
| 45 | protected List<Object> getIdentity() { |
| 46 | return IDENTITY; |
| 47 | } |
| 48 | |
| 49 | @Override |
| 50 | protected CompiledExtractorBase<java.lang.Object, java.lang.Object, java.lang.Object> newInstance(int[] map) { |
| 51 | return new Extractor19(map); |
| 52 | } |
| 53 | |
| 54 | public String toString() { |
| 55 | return getClass().getName()+" [Expression = (int) hello.charAt(0), Parameters = [Parameter[idx=0, type=class java.lang.String, name=hello]], Parameter indices = "+parameterIndices()+"]"; |
| 56 | } |
| 57 | |
| 58 | } |