@Override public TemplateModel get(int i) throws TemplateModelException { synchronized (SimpleSequence.this) { return SimpleSequence.this.get(i); } }
@Override public TemplateModel get(int i) throws TemplateModelException { synchronized (SimpleSequence.this) { return SimpleSequence.this.get(i); } }
@Override public TemplateModel get(int i) throws TemplateModelException { synchronized (SimpleSequence.this) { return SimpleSequence.this.get(i); } }
public TemplateModel get(int i) throws TemplateModelException { synchronized (SimpleSequence.this) { return SimpleSequence.this.get(i); } }
/** * Converts a FreeMarker {@link SimpleSequence} to a {@link Set}. * */ public static Set<String> simpleSequenceToSet(SimpleSequence simpleSequence) { if (simpleSequence == null) return Collections.emptySet(); Set<String> result = new HashSet<>(); for (int i = 0; i < simpleSequence.size(); i++) { try { Object sequenceEntry = simpleSequence.get(i); if (sequenceEntry instanceof SimpleScalar) { result.add(((SimpleScalar) sequenceEntry).getAsString()); } else { result.add(simpleSequence.get(i).toString()); } } catch (Exception e) { throw new RuntimeException(e); } } return result; }
/** * Converts a FreeMarker {@link SimpleSequence} to a {@link Set}. * */ public static Set<String> simpleSequenceToSet(SimpleSequence simpleSequence) { if (simpleSequence == null) return Collections.emptySet(); Set<String> result = new HashSet<>(); for (int i = 0; i < simpleSequence.size(); i++) { try { Object sequenceEntry = simpleSequence.get(i); if (sequenceEntry instanceof SimpleScalar) { result.add(((SimpleScalar) sequenceEntry).getAsString()); } else { result.add(simpleSequence.get(i).toString()); } } catch (Exception e) { throw new RuntimeException(e); } } return result; }