text:
package org.elasticsearch.index.query;

import org.elasticsearch.common.xcontent.XContentBuilder;

import java.io.IOException;

/**
 * A filter that restricts search results to values that are within the given numeric range.
 *

 *
Uses the field data cache (loading all the values for the specified field into memory).
 *
 * @deprecated This filter will be removed at some point in time in favor for the range filter with the execution
 *             mode fielddata.
 */
@Deprecated
public class NumericRangeFilterBuilder extends BaseFilterBuilder {

    private final String name;

    private Object from;

    private Object to;

    private boolean includeLower = true;

    private boolean includeUpper = true;

    private Boolean cache;
    private String cacheKey;

    private String filterName;

    /**
     * A filter that restricts search results to values that are within the given range.
     *
     * @param name The field name
     */
    public NumericRangeFilterBuilder(String name) {
        this.name = name;
    }

    /**
     * The from part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder from(Object from) {
        this.from = from;
        return this;
    }

    /**
     * The from part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder from(int from) {
        this.from = from;
        return this;
    }

    /**
     * The from part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder from(long from) {
        this.from = from;
        return this;
    }

    /**
     * The from part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder from(float from) {
        this.from = from;
        return this;
    }

    /**
     * The from part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder from(double from) {
        this.from = from;
        return this;
    }

    /**
     * The from part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder gt(Object from) {
        this.from = from;
        this.includeLower = false;
        return this;
    }

    /**
     * The from part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder gt(int from) {
        this.from = from;
        this.includeLower = false;
        return this;
    }

    /**
     * The from part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder gt(long from) {
        this.from = from;
        this.includeLower = false;
        return this;
    }

    /**
     * The from part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder gt(float from) {
        this.from = from;
        this.includeLower = false;
        return this;
    }

    /**
     * The from part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder gt(double from) {
        this.from = from;
        this.includeLower = false;
        return this;
    }

    /**
     * The from part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder gte(Object from) {
        this.from = from;
        this.includeLower = true;
        return this;
    }

    /**
     * The from part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder gte(int from) {
        this.from = from;
        this.includeLower = true;
        return this;
    }

    /**
     * The from part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder gte(long from) {
        this.from = from;
        this.includeLower = true;
        return this;
    }

    /**
     * The from part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder gte(float from) {
        this.from = from;
        this.includeLower = true;
        return this;
    }

    /**
     * The from part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder gte(double from) {
        this.from = from;
        this.includeLower = true;
        return this;
    }

    /**
     * The to part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder to(Object to) {
        this.to = to;
        return this;
    }

    /**
     * The to part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder to(int to) {
        this.to = to;
        return this;
    }

    /**
     * The to part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder to(long to) {
        this.to = to;
        return this;
    }

    /**
     * The to part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder to(float to) {
        this.to = to;
        return this;
    }

    /**
     * The to part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder to(double to) {
        this.to = to;
        return this;
    }

    /**
     * The to part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder lt(Object to) {
        this.to = to;
        this.includeUpper = false;
        return this;
    }

    /**
     * The to part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder lt(int to) {
        this.to = to;
        this.includeUpper = false;
        return this;
    }

    /**
     * The to part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder lt(long to) {
        this.to = to;
        this.includeUpper = false;
        return this;
    }

    /**
     * The to part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder lt(float to) {
        this.to = to;
        this.includeUpper = false;
        return this;
    }

    /**
     * The to part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder lt(double to) {
        this.to = to;
        this.includeUpper = false;
        return this;
    }

    /**
     * The to part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder lte(Object to) {
        this.to = to;
        this.includeUpper = true;
        return this;
    }

    /**
     * The to part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder lte(int to) {
        this.to = to;
        this.includeUpper = true;
        return this;
    }

    /**
     * The to part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder lte(long to) {
        this.to = to;
        this.includeUpper = true;
        return this;
    }

    /**
     * The to part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder lte(float to) {
        this.to = to;
        this.includeUpper = true;
        return this;
    }

    /**
     * The to part of the filter query. Null indicates unbounded.
     */
    public NumericRangeFilterBuilder lte(double to) {
        this.to = to;
        this.includeUpper = true;
        return this;
    }

    /**
     * Should the lower bound be included or not. Defaults to <tt>true</tt>.
     */
    public NumericRangeFilterBuilder includeLower(boolean includeLower) {
        this.includeLower = includeLower;
        return this;
    }

    /**
     * Should the upper bound be included or not. Defaults to <tt>true</tt>.
     */
    public NumericRangeFilterBuilder includeUpper(boolean includeUpper) {
        this.includeUpper = includeUpper;
        return this;
    }

    /**
     * Sets the filter name for the filter that can be used when searching for matched_filters per hit.
     */
    public NumericRangeFilterBuilder filterName(String filterName) {
        this.filterName = filterName;
        return this;
    }

    /**
     * Should the filter be cached or not. Defaults to <tt>false</tt>.
     */
    public NumericRangeFilterBuilder cache(boolean cache) {
        this.cache = cache;
        return this;
    }

    public NumericRangeFilterBuilder cacheKey(String cacheKey) {
        this.cacheKey = cacheKey;
        return this;
    }

    @Override
    protected void doXContent(XContentBuilder builder, Params params) throws IOException {
        builder.startObject(NumericRangeFilterParser.NAME);

        builder.startObject(name);
        builder.field("from", from);
        builder.field("to", to);
        builder.field("include_lower", includeLower);
        builder.field("include_upper", includeUpper);
        builder.endObject();

        if (filterName != null) {
            builder.field("_name", filterName);
        }
        if (cache != null) {
            builder.field("_cache", cache);
        }
        if (cacheKey != null) {
            builder.field("_cache_key", cacheKey);
        }

        builder.endObject();
    }
}


text:
layout: page
title: "About"
header-img: "img/about-bg.jpg"
---

Hi!, I'm Ian. I write code and make fonts and take care of a fat dog named Scurvy. You can find me on Twitter, on YouTube, and in Los Angeles.

redpajama_set_name: RedPajamaGithub


text:
package org.waveprotocol.wave.model.experimental.schema;

import junit.framework.TestCase;

import org.waveprotocol.wave.model.document.operation.Attributes;
import org.waveprotocol.wave.model.document.operation.AttributesUpdate;
import org.waveprotocol.wave.model.document.operation.impl.AttributesImpl;
import org.waveprotocol.wave.model.document.operation.impl.AttributesUpdateImpl;
import org.waveprotocol.wave.model.experimental.schema.AttributeValidationResult.AttributeNotAllowed;
import org.waveprotocol.wave.model.experimental.schema.AttributeValidationResult.InvalidAttributeValue;
import org.waveprotocol.wave.model.experimental.schema.AttributeValidationResult.MissingRequiredAttribute;
import org.waveprotocol.wave.model.experimental.schema.AttributeValidationResult.RemovingRequiredAttribute;
import org.waveprotocol.wave.model.experimental.schema.AttributeValidationResult.Type;
import org.waveprotocol.wave.model.experimental.schema.DocInitializationParser.ParseException;
import org.waveprotocol.wave.model.experimental.schema.SchemaPattern.Prologue;

import java.io.IOException;
import java.io.InputStream;

/**
 * Tests for SchemaPattern.
 *
 */

public class SchemaFactoryTest extends TestCase {

  private static final Attributes SAMPLE_ATTRIBUTES =
      new AttributesImpl(
          "name1", "value1",
          "name2", "value2");

  private static final AttributesUpdate SAMPLE_ATTRIBUTES_UPDATE =
      new AttributesUpdateImpl(
          "name1", "oldValue1", "newValue1",
          "name2", null, "newValue2",
          "name3", "oldValue3", null);

  /**
   * Tests a schema featuring elements and prologues.
   */
  public void testGoodSchema1() throws InvalidSchemaException, IOException, ParseException {
    SchemaPattern test = readSchema("good1.schema");
    assertEquals(0, test.prologue().size());
    checkValidation_ANA(test.validateAttributes(SAMPLE_ATTRIBUTES), "name1");
    checkValidation_ANA(test.validateAttributesUpdate(SAMPLE_ATTRIBUTES_UPDATE), "name1");
    assertEquals(0, test.validateCharacters("abcd"));
    assertNull(test.child("bad"));
    SchemaPattern test_prologueTest = test.child("prologueTest");
    Prologue test_prologueTest_prologue = test_prologueTest.prologue();
    assertEquals(3, test_prologueTest_prologue.size());
    assertEquals("element1", test_prologueTest_prologue.get(0).elementType());
    assertEquals("element2", test_prologueTest_prologue.get(1).elementType());
    assertEquals("element3", test_prologueTest_prologue.get(2).elementType());
    SchemaPattern test_prologueTest_prologue0 = test_prologueTest_prologue.get(0).pattern();
    assertEquals(0, test_prologueTest_prologue0.prologue().size());
    checkValidation_ANA(test_prologueTest_prologue0.validateAttributes(SAMPLE_ATTRIBUTES), "name1");
    checkValidation_ANA(test_prologueTest_prologue0.validateAttributesUpdate(
        SAMPLE_ATTRIBUTES_UPDATE), "name1");
    assertEquals(0, test_prologueTest_prologue0.validateCharacters("abcd"));
    assertNull(test_prologueTest_prologue0.child("bad"));
    SchemaPattern test_prologueTest_prologue1 = test_prologueTest_prologue.get(1).pattern();
    checkEmptyPattern(test_prologueTest_prologue1);
    SchemaPattern test_prologueTest_prologue2 = test_prologueTest_prologue.get(2).pattern();
    Prologue test_prologueTest_prologue2_prologue = test_prologueTest_prologue2.prologue();
    assertEquals(2, test_prologueTest_prologue2_prologue.size());
    assertEquals("element7", test_prologueTest_prologue2_prologue.get(0).elementType());
    assertEquals("element8", test_prologueTest_prologue2_prologue.get(1).elementType());
    checkValidation_ANA(test_prologueTest_prologue2.validateAttributes(SAMPLE_ATTRIBUTES), "name1");
    checkValidation_ANA(test_prologueTest_prologue2.validateAttributesUpdate(
        SAMPLE_ATTRIBUTES_UPDATE), "name1");
    assertEquals(0, test_prologueTest_prologue2.validateCharacters("abcd"));
    assertNull(test_prologueTest_prologue2.child("bad"));
    checkEmptyPattern(test_prologueTest_prologue0.child("element4"));
    checkEmptyPattern(test_prologueTest_prologue2_prologue.get(0).pattern());
    checkEmptyPattern(test_prologueTest_prologue2_prologue.get(1).pattern());
    checkEmptyPattern(test_prologueTest_prologue2.child("element5"));
    checkEmptyPattern(test_prologueTest_prologue2.child("element6"));
  }

  /**
   * Tests a schema featuring attributes.
   */
  public void testGoodSchema2() throws InvalidSchemaException, IOException, ParseException {
    SchemaPattern test = readSchema("good2.schema");

    /*
     * Test a pattern containing a single non-required attribute whose only
     * allowed value is a fixed string.
     */
    SchemaPattern test_element1 = test.child("element1");
    checkValidation_ANA(test_element1.validateAttributes(new AttributesImpl(
        "bad", "value1")),
        "bad");
    checkValidation_IAV(test_element1.validateAttributes(new AttributesImpl(
        "attribute1", "bad")),
        "attribute1", "bad");
    checkValidation_V(test_element1.validateAttributes(new AttributesImpl(
        "attribute1", "value1")));
    checkValidation_V(test_element1.validateAttributes(AttributesImpl.EMPTY_MAP));
    checkValidation_ANA(test_element1.validateAttributes(new AttributesImpl(
        "attribute1", "value1",
        "bad", "bad")),
        "bad");
    checkValidation_ANA(test_element1.validateAttributesUpdate(new AttributesUpdateImpl(
        "bad", "value1", "value1")),
        "bad");
    checkValidation_IAV(test_element1.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute1", "bad", "bad")),
        "attribute1", "bad");
    checkValidation_V(test_element1.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute1", "value1", "value1")));
    checkValidation_V(test_element1.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute1", null, "value1")));
    checkValidation_V(test_element1.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute1", "value1", null)));
    checkValidation_V(test_element1.validateAttributesUpdate(AttributesUpdateImpl.EMPTY_MAP));
    checkValidation_ANA(test_element1.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute1", "value1", "value1",
        "bad", "bad", "bad")),
        "bad");

    /*
     * Test a pattern containing a single non-required attribute with an
     * infinite number of possible values matching a regular expression.
     */
    SchemaPattern test_element2 = test.child("element2");
    checkValidation_ANA(test_element2.validateAttributes(new AttributesImpl(
        "bad", "abbbc")),
        "bad");
    checkValidation_IAV(test_element2.validateAttributes(new AttributesImpl(
        "attribute2", "bad")),
        "attribute2", "bad");
    checkValidation_V(test_element2.validateAttributes(new AttributesImpl(
        "attribute2", "abbbc")));
    checkValidation_ANA(test_element2.validateAttributesUpdate(new AttributesUpdateImpl(
        "bad", "abbbc", "abbbc")),
        "bad");
    checkValidation_IAV(test_element2.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute2", "bad", "bad")),
        "attribute2", "bad");
    checkValidation_V(test_element2.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute2", "abbbc", "abbbc")));
    checkValidation_V(test_element2.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute2", null, "abbbc")));
    checkValidation_V(test_element2.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute2", "abbbc", null)));

    /*
     * Test a pattern containing a mixture of required and non-required attributes.
     */
    SchemaPattern test_element3 = test.child("element3");
    checkValidation_MRA(test_element3.validateAttributes(new AttributesImpl(
        "bad", "value1")),
        "attribute3");
    checkValidation_ANA(test_element3.validateAttributes(new AttributesImpl(
        "attribute3", "value3",
        "bad", "bad")),
        "bad");
    checkValidation_V(test_element3.validateAttributes(new AttributesImpl(
        "attribute3", "value3")));
    checkValidation_V(test_element3.validateAttributes(new AttributesImpl(
        "attribute3", "value3",
        "attribute4", "value4",
        "attribute5", "value5")));
    checkValidation_IAV(test_element3.validateAttributes(new AttributesImpl(
        "attribute3", "bad",
        "attribute4", "value4",
        "attribute5", "value5")),
        "attribute3", "bad");
    checkValidation_IAV(test_element3.validateAttributes(new AttributesImpl(
        "attribute3", "value3",
        "attribute4", "bad",
        "attribute5", "value5")),
        "attribute4", "bad");
    checkValidation_MRA(test_element3.validateAttributes(new AttributesImpl(
        "attribute4", "value4",
        "attribute5", "value5")),
        "attribute3");
    checkValidation_MRA(test_element3.validateAttributes(AttributesImpl.EMPTY_MAP),
        "attribute3");
    checkValidation_ANA(test_element3.validateAttributesUpdate(new AttributesUpdateImpl(
        "bad", "value1", "value1")),
        "bad");
    checkValidation_ANA(test_element3.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute3", "value3", "value3",
        "bad", "bad", "bad")),
        "bad");
    checkValidation_V(test_element3.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute3", "value3", "value3")));
    checkValidation_RRA(test_element3.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute3", "value3", null)),
        "attribute3");
    checkValidation_V(test_element3.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute3", "value3", "value3",
        "attribute4", "value4", "value4",
        "attribute5", "value5", "value5")));
    checkValidation_IAV(test_element3.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute3", "bad", "bad",
        "attribute4", "value4", "value4",
        "attribute5", "value5", "value5")),
        "attribute3", "bad");
    checkValidation_IAV(test_element3.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute3", "value3", "value3",
        "attribute4", "bad", "bad",
        "attribute5", "value5", "value5")),
        "attribute4", "bad");
    checkValidation_V(test_element3.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute4", "value4", "value4",
        "attribute5", "value5", "value5")));
    checkValidation_V(test_element3.validateAttributesUpdate(AttributesUpdateImpl.EMPTY_MAP));

    /*
     * Test a pattern containing a single required attribute attribute.
     */
    SchemaPattern test_element4 = test.child("element4");
    checkValidation_IAV(test_element4.validateAttributes(new AttributesImpl(
        "attribute6", "xyz")),
        "attribute6", "xyz");
    checkValidation_IAV(test_element4.validateAttributes(new AttributesImpl(
        "attribute6", "axyz")),
        "attribute6", "axyz");
    checkValidation_IAV(test_element4.validateAttributes(new AttributesImpl(
        "attribute6", "xyzb")),
        "attribute6", "xyzb");
    checkValidation_V(test_element4.validateAttributes(new AttributesImpl(
        "attribute6", "axyzb")));
    checkValidation_IAV(test_element4.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute6", "xyz", "xyz")),
        "attribute6", "xyz");
    checkValidation_IAV(test_element4.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute6", "axyz", "axyz")),
        "attribute6", "axyz");
    checkValidation_IAV(test_element4.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute6", "xyzb", "xyzb")),
        "attribute6", "xyzb");
    checkValidation_V(test_element4.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute6", "axyzb", "axyzb")));

    /*
     * Test that the "casting" methods of the result objects returned by the
     * validation behave correctly.
     */
    AttributeValidationResult example_V = test_element3.validateAttributes(
        new AttributesImpl(
            "attribute3", "value3"));
    AttributeValidationResult example_ANA = test_element3.validateAttributes(
        new AttributesImpl(
            "attribute3", "value3",
            "bad", "bad"));
    AttributeValidationResult example_IAV = test_element3.validateAttributes(
        new AttributesImpl(
            "attribute3", "bad"));
    AttributeValidationResult example_MRA = test_element3.validateAttributes(
        AttributesImpl.EMPTY_MAP);
    AttributeValidationResult example_RRA = test_element3.validateAttributesUpdate(
        new AttributesUpdateImpl(
            "attribute3", "value3", null));
    assertNull(example_V.asAttributeNotAllowed());
    assertNull(example_V.asInvalidAttributeValue());
    assertNull(example_V.asMissingRequiredAttribute());
    assertNull(example_V.asRemovingRequiredAttribute());
    assertNotNull(example_ANA.asAttributeNotAllowed());
    assertNull(example_ANA.asInvalidAttributeValue());
    assertNull(example_ANA.asMissingRequiredAttribute());
    assertNull(example_ANA.asRemovingRequiredAttribute());
    assertNull(example_IAV.asAttributeNotAllowed());
    assertNotNull(example_IAV.asInvalidAttributeValue());
    assertNull(example_IAV.asMissingRequiredAttribute());
    assertNull(example_IAV.asRemovingRequiredAttribute());
    assertNull(example_MRA.asAttributeNotAllowed());
    assertNull(example_MRA.asInvalidAttributeValue());
    assertNotNull(example_MRA.asMissingRequiredAttribute());
    assertNull(example_MRA.asRemovingRequiredAttribute());
    assertNull(example_RRA.asAttributeNotAllowed());
    assertNull(example_RRA.asInvalidAttributeValue());
    assertNull(example_RRA.asMissingRequiredAttribute());
    assertNotNull(example_RRA.asRemovingRequiredAttribute());
  }

  /**
   * Tests a schema featuring character data.
   */
  public void testGoodSchema3() throws InvalidSchemaException, IOException, ParseException {
    SchemaPattern test = readSchema("good3.schema");
    SchemaPattern test_element1 = test.child("element1");
    assertEquals(-1, test_element1.validateCharacters("eeeeeeee"));
    assertEquals(-1, test_element1.validateCharacters("ffffffff"));
    assertEquals(-1, test_element1.validateCharacters("efghefgh"));
    assertEquals(0, test_element1.validateCharacters("aaaaaaaa"));
    assertEquals(0, test_element1.validateCharacters("bbbbbbbb"));
    assertEquals(4, test_element1.validateCharacters("efgha"));
    SchemaPattern test_element2 = test.child("element2");
    assertEquals(-1, test_element2.validateCharacters("aaaaaaaa"));
    assertEquals(-1, test_element2.validateCharacters("bbbbbbbb"));
    assertEquals(-1, test_element2.validateCharacters("abcdabcd"));
    assertEquals(0, test_element2.validateCharacters("eeeeeeee"));
    assertEquals(0, test_element2.validateCharacters("ffffffff"));
    assertEquals(4, test_element2.validateCharacters("abcde"));
  }

  /**
   * Tests a schema featuring a top-level prologue.
   */
  public void testGoodSchema4() throws InvalidSchemaException, IOException, ParseException {
    SchemaPattern test = readSchema("good4.schema");
    Prologue test_prologue = test.prologue();
    assertEquals(3, test_prologue.size());
    assertEquals("element1", test_prologue.get(0).elementType());
    assertEquals("element2", test_prologue.get(1).elementType());
    assertEquals("element3", test_prologue.get(2).elementType());
    checkValidation_ANA(test.validateAttributes(SAMPLE_ATTRIBUTES), "name1");
    checkValidation_ANA(test.validateAttributesUpdate(SAMPLE_ATTRIBUTES_UPDATE), "name1");
    assertEquals(0, test.validateCharacters("abcd"));
    assertNull(test.child("bad"));
    SchemaPattern test_prologue0 = test_prologue.get(0).pattern();
    assertEquals(0, test_prologue0.prologue().size());
    checkValidation_ANA(test_prologue0.validateAttributes(SAMPLE_ATTRIBUTES), "name1");
    checkValidation_ANA(test_prologue0.validateAttributesUpdate(SAMPLE_ATTRIBUTES_UPDATE), "name1");
    assertEquals(0, test_prologue0.validateCharacters("abcd"));
    assertNull(test_prologue0.child("bad"));
    SchemaPattern test_prologue1 = test_prologue.get(1).pattern();
    checkEmptyPattern(test_prologue1);
    SchemaPattern test_prologue2 = test_prologue.get(2).pattern();
    Prologue test_prologue2_prologue = test_prologue2.prologue();
    assertEquals(2, test_prologue2_prologue.size());
    assertEquals("element7", test_prologue2_prologue.get(0).elementType());
    assertEquals("element8", test_prologue2_prologue.get(1).elementType());
    checkValidation_ANA(test_prologue2.validateAttributes(SAMPLE_ATTRIBUTES), "name1");
    checkValidation_ANA(test_prologue2.validateAttributesUpdate(SAMPLE_ATTRIBUTES_UPDATE), "name1");
    assertEquals(0, test_prologue2.validateCharacters("abcd"));
    assertNull(test_prologue2.child("bad"));
    checkEmptyPattern(test_prologue0.child("element4"));
    checkEmptyPattern(test_prologue2_prologue.get(0).pattern());
    checkEmptyPattern(test_prologue2_prologue.get(1).pattern());
    checkEmptyPattern(test_prologue2.child("element5"));
    checkEmptyPattern(test_prologue2.child("element6"));
  }

  /**
   * Tests a schema featuring top-level optional attributes.
   */
  public void testGoodSchema5() throws InvalidSchemaException, IOException, ParseException {
    SchemaPattern test = readSchema("good5.schema");
    checkValidation_ANA(test.validateAttributes(new AttributesImpl(
        "bad", "value1")),
        "bad");
    checkValidation_ANA(test.validateAttributes(new AttributesImpl(
        "attribute1", "value1",
        "bad", "bad")),
        "bad");
    checkValidation_V(test.validateAttributes(new AttributesImpl(
        "attribute1", "value1")));
    checkValidation_V(test.validateAttributes(new AttributesImpl(
        "attribute1", "value1",
        "attribute2", "abbbc",
        "attribute3", "axyzb")));
    checkValidation_IAV(test.validateAttributes(new AttributesImpl(
        "attribute1", "bad",
        "attribute2", "abbbc",
        "attribute3", "axyzb")),
        "attribute1", "bad");
    checkValidation_V(test.validateAttributes(AttributesImpl.EMPTY_MAP));
    checkValidation_ANA(test.validateAttributesUpdate(new AttributesUpdateImpl(
        "bad", "value1", "value1")),
        "bad");
    checkValidation_ANA(test.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute1", "value1", "value1",
        "bad", "bad", "bad")),
        "bad");
    checkValidation_V(test.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute1", "value1", "value1")));
    checkValidation_V(test.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute1", "value1", null)));
    checkValidation_V(test.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute1", "value1", "value1",
        "attribute2", "abbbc", "abbbc",
        "attribute3", "axyzb", "axyzb")));
    checkValidation_IAV(test.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute1", "bad", "bad",
        "attribute2", "abbbc", "abbbc",
        "attribute3", "axyzb", "axyzb")),
        "attribute1", "bad");
    checkValidation_V(test.validateAttributesUpdate(AttributesUpdateImpl.EMPTY_MAP));
  }

  /**
   * Tests a schema featuring top-level attributes, including a required attribute.
   */
  public void testGoodSchema6() throws InvalidSchemaException, IOException, ParseException {
    SchemaPattern test = readSchema("good6.schema");
    checkValidation_MRA(test.validateAttributes(new AttributesImpl(
        "bad", "value1")),
        "attribute1");
    checkValidation_ANA(test.validateAttributes(new AttributesImpl(
        "attribute1", "value1",
        "bad", "bad")),
        "bad");
    checkValidation_V(test.validateAttributes(new AttributesImpl(
        "attribute1", "value1")));
    checkValidation_V(test.validateAttributes(new AttributesImpl(
        "attribute1", "value1",
        "attribute2", "abbbc",
        "attribute3", "axyzb")));
    checkValidation_IAV(test.validateAttributes(new AttributesImpl(
        "attribute1", "bad",
        "attribute2", "abbbc",
        "attribute3", "axyzb")),
        "attribute1", "bad");
    checkValidation_IAV(test.validateAttributes(new AttributesImpl(
        "attribute1", "value1",
        "attribute2", "bad",
        "attribute3", "axyzb")),
        "attribute2", "bad");
    checkValidation_MRA(test.validateAttributes(new AttributesImpl(
        "attribute2", "abbbc",
        "attribute3", "axyzb")),
        "attribute1");
    checkValidation_MRA(test.validateAttributes(AttributesImpl.EMPTY_MAP),
        "attribute1");
    checkValidation_ANA(test.validateAttributesUpdate(new AttributesUpdateImpl(
        "bad", "value1", "value1")),
        "bad");
    checkValidation_ANA(test.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute1", "value1", "value1",
        "bad", "bad", "bad")),
        "bad");
    checkValidation_V(test.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute1", "value1", "value1")));
    checkValidation_RRA(test.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute1", "value1", null)),
        "attribute1");
    checkValidation_V(test.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute1", "value1", "value1",
        "attribute2", "abbbc", "abbbc",
        "attribute3", "axyzb", "axyzb")));
    checkValidation_IAV(test.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute1", "bad", "bad",
        "attribute2", "abbbc", "abbbc",
        "attribute3", "axyzb", "axyzb")),
        "attribute1", "bad");
    checkValidation_IAV(test.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute1", "value1", "value1",
        "attribute2", "bad", "bad",
        "attribute3", "axyzb", "axyzb")),
        "attribute2", "bad");
    checkValidation_V(test.validateAttributesUpdate(new AttributesUpdateImpl(
        "attribute2", "abbbc", "abbbc",
        "attribute3", "axyzb", "axyzb")));
    checkValidation_V(test.validateAttributesUpdate(AttributesUpdateImpl.EMPTY_MAP));
  }

  /**
   * Tests a schema featuring top-level character data with blacklisting of characters.
   */
  public void testGoodSchema7() throws InvalidSchemaException, IOException, ParseException {
    SchemaPattern test = readSchema("good7.schema");
    assertEquals(-1, test.validateCharacters("eeeeeeee"));
    assertEquals(-1, test.validateCharacters("ffffffff"));
    assertEquals(-1, test.validateCharacters("efghefgh"));
    assertEquals(0, test.validateCharacters("aaaaaaaa"));
    assertEquals(0, test.validateCharacters("bbbbbbbb"));
    assertEquals(4, test.validateCharacters("efgha"));
  }

  /**
   * Tests a schema featuring top-level character data with whitelisting of characters.
   */
  public void testGoodSchema8() throws InvalidSchemaException, IOException, ParseException {
    SchemaPattern test = readSchema("good8.schema");
    assertEquals(-1, test.validateCharacters("aaaaaaaa"));
    assertEquals(-1, test.validateCharacters("bbbbbbbb"));
    assertEquals(-1, test.validateCharacters("abcdabcd"));
    assertEquals(0, test.validateCharacters("eeeeeeee"));
    assertEquals(0, test.validateCharacters("ffffffff"));
    assertEquals(4, test.validateCharacters("abcde"));
  }

  /**
   * Tests a schema featuring references.
   */
  public void testGoodSchema9() throws InvalidSchemaException, IOException, ParseException {
    SchemaPattern test = readSchema("good9.schema");
    checkValidation_V(test.validateAttributes(new AttributesImpl("attribute1", "value1")));
    checkValidation_V(test.validateAttributes(new AttributesImpl("attribute2", "value2")));
    checkValidation_ANA(test.validateAttributes(new AttributesImpl("bad", "bad")), "bad");
    SchemaPattern test_element1 = test.child("element1");
    assertNull(test_element1.child("bad"));
    assertNotNull(test_element1.child("element4"));
    SchemaPattern test_element2 = test.child("element2");
    assertNull(test_element2.child("bad"));
    assertNotNull(test_element2.child("element4"));
    SchemaPattern test_element3 = test.child("element3");
    assertNull(test_element3.child("element4"));
  }

  /**
   * Tests a schema featuring a nested reference.
   */
  public void testGoodSchema10() throws InvalidSchemaException, IOException, ParseException {
    SchemaPattern test = readSchema("good10.schema");
    SchemaPattern test_element0 = test.child("element0");
    checkValidation_V(test_element0.validateAttributes(new AttributesImpl("attribute1", "value1")));
    checkValidation_V(test_element0.validateAttributes(new AttributesImpl("attribute2", "value2")));
    checkValidation_ANA(test_element0.validateAttributes(new AttributesImpl("bad", "bad")), "bad");
    SchemaPattern test_element0_element1 = test_element0.child("element1");
    assertNull(test_element0_element1.child("bad"));
    assertNotNull(test_element0_element1.child("element4"));
    SchemaPattern test_element0_element2 = test_element0.child("element2");
    assertNull(test_element0_element2.child("bad"));
    assertNotNull(test_element0_element2.child("element4"));
    SchemaPattern test_element0_element3 = test_element0.child("element3");
    assertNull(test_element0_element3.child("element4"));
  }

  /**
   * Tests a schema featuring references involving required attributes.
   */
  public void testGoodSchema11() throws InvalidSchemaException, IOException, ParseException {
    SchemaPattern test = readSchema("good11.schema");
    checkValidation_V(test.validateAttributes(new AttributesImpl(
        "attribute1", "value1",
        "attribute2", "value2",
        "attribute3", "value3",
        "attribute4", "value4")));
    checkValidation_V(test.validateAttributes(new AttributesImpl(
        "attribute1", "value1",
        "attribute3", "value3",
        "attribute4", "value4")));
    checkValidation_V(test.validateAttributes(new AttributesImpl(
        "attribute1", "value1",
        "attribute2", "value2",
        "attribute3", "value3")));
    checkValidation_MRA(test.validateAttributes(new AttributesImpl(
        "attribute2", "value2",
        "attribute3", "value3",
        "attribute4", "value4")),
        "attribute1");
    checkValidation_MRA(test.validateAttributes(new AttributesImpl(
        "attribute1", "value1",
        "attribute2", "value2",
        "attribute4", "value4")),
        "attribute3");
    checkValidation_ANA(test.validateAttributes(new AttributesImpl(
        "attribute1", "value1",
        "attribute2", "value2",
        "attribute3", "value3",
        "attribute4", "value4",
        "bad", "bad")),
        "bad");
  }

  /**
   * Tests a schema featuring references with double indirection.
   */
  public void testGoodSchema12() throws InvalidSchemaException, IOException, ParseException {
    SchemaPattern test = readSchema("good12.schema");
    checkValidation_V(test.validateAttributes(new AttributesImpl("attribute1", "value1")));
    checkValidation_V(test.validateAttributes(new AttributesImpl("attribute2", "value2")));
    checkValidation_V(test.validateAttributes(new AttributesImpl("attribute3", "value3")));
    checkValidation_ANA(test.validateAttributes(new AttributesImpl("bad", "bad")), "bad");
    SchemaPattern test_element1 = test.child("element1");
    assertNull(test_element1.child("bad"));
    assertNotNull(test_element1.child("element4"));
    SchemaPattern test_element2 = test.child("element2");
    assertNull(test_element2.child("bad"));
    assertNotNull(test_element2.child("element5"));
    SchemaPattern test_element3 = test.child("element3");
    assertNull(test_element2.child("bad"));
    assertNotNull(test_element3.child("element6"));
  }

  /**
   * Tests a schema featuring a recursive reference.
   */
  public void testGoodSchema13() throws InvalidSchemaException, IOException, ParseException {
    SchemaPattern test = readSchema("good13.schema");
    for (int i = 0; i < 16; ++i) {
      checkValidation_V(test.validateAttributes(new AttributesImpl("attribute1", "value1")));
      checkValidation_ANA(test.validateAttributes(new AttributesImpl("bad", "bad")), "bad");
      test = test.child("element1");
    }
  }

  /**
   * Tests a schema featuring recursive references.
   */
  public void testGoodSchema14() throws InvalidSchemaException, IOException, ParseException {
    SchemaPattern pattern = readSchema("good14.schema");
    String[] elements = { "element1", "element2", "element3" };
    String[] attributes = { "attribute1", "attribute2", "attribute3" };
    String[] values = { "value1", "value2", "value3" };
    for (int i = 0; i < 16; ++i) {
      int k0 = i % 3;
      int k1 = (i + 1) % 3;
      int k2 = (i + 2) % 3;
      checkValidation_V(pattern.validateAttributes(new AttributesImpl(attributes[k0], values[k0])));
      checkValidation_ANA(
          pattern.validateAttributes(new AttributesImpl(attributes[k1], values[k1])),
          attributes[k1]);
      checkValidation_ANA(
          pattern.validateAttributes(new AttributesImpl(attributes[k2], values[k2])),
          attributes[k2]);
      pattern = pattern.child(elements[i % 3]);
    }
  }

  /**
   * Tests a schema featuring the interleaving of prologues and referenced
   * patterns containing prologues.
   */
  public void testGoodSchema15() throws InvalidSchemaException, IOException, ParseException {
    SchemaPattern test = readSchema("good15.schema");
    Prologue prologue = test.prologue();
    assertEquals(8, test.prologue().size());
    assertEquals("element1", prologue.get(0).elementType());
    assertEquals("element2", prologue.get(1).elementType());
    assertEquals("element5", prologue.get(2).elementType());
    assertEquals("element6", prologue.get(3).elementType());
    assertEquals("element3", prologue.get(4).elementType());
    assertEquals("element4", prologue.get(5).elementType());
    assertEquals("element5", prologue.get(6).elementType());
    assertEquals("element6", prologue.get(7).elementType());
    assertNotNull(prologue.get(0).pattern().child("element7"));
    assertNotNull(prologue.get(1).pattern().child("element8"));
    assertNotNull(prologue.get(2).pattern().child("element11"));
    assertNotNull(prologue.get(3).pattern().child("element12"));
    assertNotNull(prologue.get(4).pattern().child("element9"));
    assertNotNull(prologue.get(5).pattern().child("element10"));
    assertNotNull(prologue.get(6).pattern().child("element11"));
    assertNotNull(prologue.get(7).pattern().child("element12"));
  }

  /**
   * Tests a schema featuring various regular expressions for attribute values.
   */
  public void testGoodSchema16() throws InvalidSchemaException, IOException, ParseException {
    SchemaPattern test = readSchema("good16.schema");
    SchemaPattern pattern = test.child("element1");
    checkValidation_V(pattern.validateAttributes(new AttributesImpl(
        "attribute1", "hello")));
    checkValidation_V(pattern.validateAttributes(new AttributesImpl(
        "attribute1", "world")));
    checkValidation_IAV(pattern.validateAttributes(new AttributesImpl(
        "attribute1", "bad")),
        "attribute1", "bad");
    checkValidation_V(pattern.validateAttributes(new AttributesImpl(
        "attribute2", "abcdgh")));
    checkValidation_V(pattern.validateAttributes(new AttributesImpl(
        "attribute2", "abefgh")));
    checkValidation_IAV(pattern.validateAttributes(new AttributesImpl(
        "attribute2", "bad")),
        "attribute2", "bad");
    checkValidation_V(pattern.validateAttributes(new AttributesImpl(
        "attribute3", "abccccccccccef")));
    checkValidation_V(pattern.validateAttributes(new AttributesImpl(
        "attribute3", "abcdef")));
    checkValidation_IAV(pattern.validateAttributes(new AttributesImpl(
        "attribute3", "abccdef")),
        "attribute3", "abccdef");
  }

  /**
   * Tests a bad schema with no root specified.
   */
  public void testBadSchema1() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad1.schema");
  }

  /**
   * Tests a bad schema with an undefined root.
   */
  public void testBadSchema2() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad2.schema");
  }

  /**
   * Tests a bad schema with a duplicate element.
   */
  public void testBadSchema3() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad3.schema");
  }

  /**
   * Tests a bad schema with a duplicate attribute.
   */
  public void testBadSchema4() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad4.schema");
  }

  /**
   * Tests a bad schema with a duplicate definition.
   */
  public void testBadSchema5() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad5.schema");
  }

  /**
   * Tests a bad schema with an element clash through a reference.
   */
  public void testBadSchema6() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad6.schema");
  }

  /**
   * Tests a bad schema with an attribute clash through a reference.
   */
  public void testBadSchema7() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad7.schema");
  }

  /**
   * Tests a bad schema with an infinite recursion.
   */
  public void testBadSchema8() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad8.schema");
  }

  /**
   * Tests a bad schema with an infinite recursion through indirect means.
   */
  public void testBadSchema9() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad9.schema");
  }

  /**
   * Tests a bad schema with a bad regular expression beginning with '*'.
   */
  public void testBadSchema10() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad10.schema");
  }

  /**
   * Tests a bad schema with a bad regular expression beginning with '?'.
   */
  public void testBadSchema11() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad11.schema");
  }

  /**
   * Tests a bad schema with a bad regular expression beginning with ')'.
   */
  public void testBadSchema12() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad12.schema");
  }

  /**
   * Tests a bad schema with a bad regular expression with an unexpected '*'.
   */
  public void testBadSchema13() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad13.schema");
  }

  /**
   * Tests a bad schema with a bad regular expression with an unexpected '?'.
   */
  public void testBadSchema14() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad14.schema");
  }

  /**
   * Tests a bad schema with a bad regular expression ending with '\\'.
   */
  public void testBadSchema15() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad15.schema");
  }

  /**
   * Tests a bad schema with a bad regular expression with a single '('.
   */
  public void testBadSchema16() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad16.schema");
  }

  /**
   * Tests a bad schema with a bad regular expression with a single ')'.
   */
  public void testBadSchema17() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad17.schema");
  }

  /**
   * Tests a bad schema with a bad regular expression with an unmatched '('.
   */
  public void testBadSchema18() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad18.schema");
  }

  /**
   * Tests a bad schema with a bad regular expression with an unmatched ')'.
   */
  public void testBadSchema19() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad19.schema");
  }

  /**
   * Tests a bad schema with a top-level reference to an undefined definition.
   */
  public void testBadSchema120() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad20.schema");
  }

  /**
   * Tests a bad schema with a reference, not at the top level, to an undefined
   * definition.
   */
  public void testBadSchema21() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad21.schema");
  }

  /**
   * Tests a bad schema containing an invalid element type.
   */
  public void testBadSchema22() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad22.schema");
  }

  /**
   * Tests a bad schema containing an unknown attribute.
   */
  public void testBadSchema23() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad23.schema");
  }

  /**
   * Tests a bad schema with a missing name attribute for a definition element.
   */
  public void testBadSchema24() throws IOException, ParseException {
    checkInvalidSchemaExceptionIsThrown("bad24.schema");
  }

  // TODO(user): We can test for more things similar to testBadSchema23 and
  // testBadSchema24.

  private static void checkEmptyPattern(SchemaPattern pattern) {
    assertEquals(0, pattern.prologue().size());
    checkValidation_ANA(pattern.validateAttributes(SAMPLE_ATTRIBUTES), "name1");
    checkValidation_ANA(pattern.validateAttributesUpdate(SAMPLE_ATTRIBUTES_UPDATE), "name1");
    assertEquals(0, pattern.validateCharacters("abcd"));
    assertNull(pattern.child("bad"));
  }

  /**
   * Checks that the validation result is VALID.
   */
  private static void checkValidation_V(AttributeValidationResult result) {
    assertEquals(Type.VALID, result.getType());
  }

  /**
   * Checks that the validation result is ATTRIBUTE_NOT_ALLOWED.
   */
  private static void checkValidation_ANA(AttributeValidationResult result, String name) {
    assertEquals(Type.ATTRIBUTE_NOT_ALLOWED, result.getType());
    AttributeNotAllowed ana = result.asAttributeNotAllowed();
    assertEquals(name, ana.getName());
  }

  /**
   * Checks that the validation result is INVALID_ATTRIBUTE_VALUE.
   */
  private static void checkValidation_IAV(AttributeValidationResult result,
      String name, String value) {
    assertEquals(Type.INVALID_ATTRIBUTE_VALUE, result.getType());
    InvalidAttributeValue iav = result.asInvalidAttributeValue();
    assertEquals(name, iav.getName());
    assertEquals(value, iav.getValue());
  }

  /**
   * Checks that the validation result is MISSING_REQUIRED_ATTRIBUTE.
   */
  private static void checkValidation_MRA(AttributeValidationResult result, String name) {
    assertEquals(Type.MISSING_REQUIRED_ATTRIBUTE, result.getType());
    MissingRequiredAttribute mra = result.asMissingRequiredAttribute();
    assertEquals(name, mra.getName());
  }

  /**
   * Checks that the validation result is REMOVING_REQUIRED_ATTRIBUTE.
   */
  private static void checkValidation_RRA(AttributeValidationResult result, String name) {
    assertEquals(Type.REMOVING_REQUIRED_ATTRIBUTE, result.getType());
    RemovingRequiredAttribute rra = result.asRemovingRequiredAttribute();
    assertEquals(name, rra.getName());
  }

  private static SchemaPattern readSchema(String filename)
      throws InvalidSchemaException, IOException, ParseException {
    InputStream stream = SchemaFactoryTest.class.getResourceAsStream(filename);
    return SchemaFactory.createSchemaPattern(DocInitializationParser.parseNonCharacterData(stream));
  }

  private static void checkInvalidSchemaExceptionIsThrown(String filename)
      throws IOException, ParseException {
    InputStream stream = SchemaFactoryTest.class.getResourceAsStream(filename);
    try {
      SchemaPattern pattern =
          SchemaFactory.createSchemaPattern(DocInitializationParser.parseNonCharacterData(stream));
      fail("The expected InvalidSchemaException was not thrown");
    } catch (InvalidSchemaException e) {
    }
  }

}


text:
get_tmux_option() {
  local option="$1"
  local default_value="$2"
  local option_value="$(tmux show-option -gqv "$option")"

  if [ -z "$option_value" ]; then
    echo "$default_value"
  else
    echo "$option_value"
  fi
}

set_tmux_option() {
	local option=$1
	local value=$2

	tmux set-option -gq "$option" "$value"
}


text:
package com.hortonworks.streamline.streams.cluster.bundle.impl;

import com.hortonworks.streamline.streams.catalog.Cluster;
import com.hortonworks.streamline.streams.cluster.bundle.AbstractKafkaBundleHintProvider;

import java.util.Map;

import javax.security.auth.Subject;
import javax.ws.rs.core.SecurityContext;

public class KafkaBundleHintProvider extends AbstractKafkaBundleHintProvider {
    @Override
    public Map<String, Object> getHintsOnCluster(Cluster cluster, SecurityContext securityContext, Subject subject) {
        return super.getHintsOnCluster(cluster, securityContext, subject);
    }

    @Override
    public String getServiceName() {
        return super.getServiceName();
    }
}


text:
package consulo.csharp.lang.psi.impl.source.resolve.type;

import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import com.intellij.psi.search.GlobalSearchScope;
import consulo.annotation.access.RequiredReadAction;
import consulo.csharp.lang.psi.impl.msil.CSharpTransform;
import consulo.dotnet.psi.DotNetTypeDeclaration;
import consulo.dotnet.resolve.DotNetGenericExtractor;
import consulo.dotnet.resolve.DotNetPsiSearcher;
import consulo.dotnet.resolve.DotNetTypeRefWithCachedResult;
import consulo.dotnet.resolve.DotNetTypeResolveResult;

import javax.annotation.Nonnull;

/**
 * @author VISTALL
 * @since 26.10.14
 */
public class CSharpTypeRefByQName extends DotNetTypeRefWithCachedResult
{
	@Nonnull
	private final String myQualifiedName;

	public CSharpTypeRefByQName(@Nonnull Project project, @Nonnull GlobalSearchScope searchScope, @Nonnull String qualifiedName)
	{
		super(project, searchScope);
		myQualifiedName = qualifiedName;
	}

	@RequiredReadAction
	@Deprecated
	public CSharpTypeRefByQName(@Nonnull PsiElement scope, @Nonnull String qualifiedName)
	{
		this(scope.getProject(), scope.getResolveScope(), qualifiedName);
	}

	@Nonnull
	@Override
	public String getVmQName()
	{
		return myQualifiedName;
	}

	@RequiredReadAction
	@Nonnull
	@Override
	protected DotNetTypeResolveResult resolveResult()
	{
		if(DumbService.isDumb(getProject()))
		{
			return DotNetTypeResolveResult.EMPTY;
		}

		DotNetTypeDeclaration type = DotNetPsiSearcher.getInstance(getProject()).findType(myQualifiedName, myResolveScope, CSharpTransform.INSTANCE);

		if(type == null)
		{
			return DotNetTypeResolveResult.EMPTY;
		}

		return new CSharpUserTypeRef.Result<>(type, DotNetGenericExtractor.EMPTY);
	}

	@Override
	public boolean isEqualToVmQName(@Nonnull String vmQName)
	{
		return vmQName.equals(myQualifiedName);
	}

	@RequiredReadAction
	@Nonnull
	@Override
	public String toString()
	{
		return myQualifiedName;
	}

	@Override
	public boolean equals(Object obj)
	{
		if(obj instanceof Delegate)
		{
			obj = ((Delegate) obj).getDelegate();
		}
		return obj instanceof CSharpTypeRefByQName && ((CSharpTypeRefByQName) obj).myQualifiedName.equals(myQualifiedName);
	}
}


text:
package org.pentaho.amazon;

import org.apache.commons.vfs.FileObject;
import org.apache.commons.vfs.FileSystemException;
import org.apache.commons.vfs.FileSystemOptions;
import org.apache.commons.vfs.auth.StaticUserAuthenticator;
import org.apache.commons.vfs.impl.DefaultFileSystemConfigBuilder;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.pentaho.amazon.emr.job.AmazonElasticMapReduceJobExecutor;
import org.pentaho.amazon.s3.S3VfsFileChooserHelper;
import org.pentaho.di.core.Const;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.exception.KettleFileException;
import org.pentaho.di.core.plugins.JobEntryPluginType;
import org.pentaho.di.core.plugins.PluginInterface;
import org.pentaho.di.core.plugins.PluginRegistry;
import org.pentaho.di.core.util.StringUtil;
import org.pentaho.di.core.variables.VariableSpace;
import org.pentaho.di.core.variables.Variables;
import org.pentaho.di.core.vfs.KettleVFS;
import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.job.entry.JobEntryInterface;
import org.pentaho.di.ui.core.PropsUI;
import org.pentaho.di.ui.core.database.dialog.tags.ExtTextbox;
import org.pentaho.di.ui.core.gui.WindowProperty;
import org.pentaho.di.ui.spoon.Spoon;
import org.pentaho.di.ui.util.HelpUtils;
import org.pentaho.s3.vfs.S3FileProvider;
import org.pentaho.ui.xul.components.XulTextbox;
import org.pentaho.ui.xul.containers.XulDialog;
import org.pentaho.ui.xul.impl.AbstractXulEventHandler;
import org.pentaho.vfs.ui.VfsFileChooserDialog;

/**
 * created by: rfellows date:       5/24/12
 */
public abstract class AbstractAmazonJobExecutorController extends AbstractXulEventHandler {

  private static final Class<?> PKG = AmazonElasticMapReduceJobExecutor.class;

  /* property change names */
  public static final String JOB_ENTRY_NAME = "jobEntryName"; //$NON-NLS-1$
  public static final String HADOOP_JOB_NAME = "hadoopJobName"; //$NON-NLS-1$
  public static final String HADOOP_JOB_FLOW_ID = "hadoopJobFlowId"; //$NON-NLS-1$
  public static final String JAR_URL = "jarUrl"; //$NON-NLS-1$
  public static final String ACCESS_KEY = "accessKey"; //$NON-NLS-1$
  public static final String SECRET_KEY = "secretKey"; //$NON-NLS-1$
  public static final String STAGING_DIR = "stagingDir"; //$NON-NLS-1$
  public static final String STAGING_DIR_FILE = "stagingDirFile"; //$NON-NLS-1$
  public static final String NUM_INSTANCES = "numInstances"; //$NON-NLS-1$
  public static final String MASTER_INSTANCE_TYPE = "masterInstanceType"; //$NON-NLS-1$
  public static final String SLAVE_INSTANCE_TYPE = "slaveInstanceType"; //$NON-NLS-1$
  public static final String CMD_LINE_ARGS = "commandLineArgs"; //$NON-NLS-1$
  public static final String BLOCKING = "blocking"; //$NON-NLS-1$
  public static final String LOGGING_INTERVAL = "loggingInterval"; //$NON-NLS-1$

  /* XUL Element id's */
  public static final String XUL_JOBENTRY_HADOOPJOB_NAME = "jobentry-hadoopjob-name";
  public static final String XUL_ACCESS_KEY1 = "access-key";
  public static final String XUL_SECRET_KEY1 = "secret-key";
  public static final String XUL_JOBENTRY_HADOOPJOB_FLOW_ID = "jobentry-hadoopjob-flow-id";
  public static final String XUL_S3_STAGING_DIRECTORY = "s3-staging-directory";
  public static final String XUL_COMMAND_LINE_ARGUMENTS = "command-line-arguments";
  public static final String XUL_NUM_INSTANCES1 = "num-instances";
  public static final String XUL_LOGGING_INTERVAL1 = "logging-interval";
  public static final String XUL_AMAZON_EMR_JOB_ENTRY_DIALOG = "amazon-emr-job-entry-dialog";
  public static final String XUL_AMAZON_EMR_ERROR_DIALOG = "amazon-emr-error-dialog";
  public static final String XUL_AMAZON_EMR_ERROR_MESSAGE = "amazon-emr-error-message";
  public static final String XUL_JAR_URL = "jar-url";

  /* Messages */
  public static final String MSG_AMAZON_ELASTIC_MAP_REDUCE_JOB_EXECUTOR_JOB_ENTRY_NAME_ERROR =
    "AmazonElasticMapReduceJobExecutor.JobEntryName.Error";
  public static final String MSG_AMAZON_ELASTIC_MAP_REDUCE_JOB_EXECUTOR_JOB_FLOW_NAME_ERROR =
    "AmazonElasticMapReduceJobExecutor.JobFlowName.Error";
  public static final String MSG_AMAZON_ELASTIC_MAP_REDUCE_JOB_EXECUTOR_ACCESS_KEY_ERROR =
    "AmazonElasticMapReduceJobExecutor.AccessKey.Error";
  public static final String MSG_AMAZON_ELASTIC_MAP_REDUCE_JOB_EXECUTOR_SECRET_KEY_ERROR =
    "AmazonElasticMapReduceJobExecutor.SecretKey.Error";
  public static final String MSG_AMAZON_ELASTIC_MAP_REDUCE_JOB_EXECUTOR_STAGING_DIR_ERROR =
    "AmazonElasticMapReduceJobExecutor.StagingDir.Error";
  public static final String MSG_AMAZON_ELASTIC_MAP_REDUCE_JOB_EXECUTOR_MASTER_INSTANCE_TYPE_ERROR =
    "AmazonElasticMapReduceJobExecutor.MasterInstanceType.Error";
  public static final String MSG_AMAZON_ELASTIC_MAP_REDUCE_JOB_EXECUTOR_SLAVE_INSTANCE_TYPE_ERROR =
    "AmazonElasticMapReduceJobExecutor.SlaveInstanceType.Error";
  public static final String MSG_DIALOG_ERROR = "Dialog.Error";
  public static final String MSG_AMAZON_ELASTIC_MAP_REDUCE_JOB_EXECUTOR_JAR_URL_ERROR =
    "AmazonElasticMapReduceJobExecutor.JarURL.Error";

  protected String jobEntryName;
  protected String hadoopJobName;
  protected String hadoopJobFlowId;
  protected String accessKey = "";
  protected String secretKey = "";

  protected String stagingDir = "";
  protected FileObject stagingDirFile = null;
  protected String jarUrl = "";

  protected String numInstances = "2";
  protected String masterInstanceType = "m1.small";
  protected String slaveInstanceType = "m1.small";
  protected String cmdLineArgs;
  protected boolean blocking;
  protected String loggingInterval = "60"; // 60 seconds

  protected VfsFileChooserDialog fileChooserDialog;
  protected S3VfsFileChooserHelper helper;

  public void accept() {

    syncModel();

    String validationErrors = buildValidationErrorMessages();

    if ( !StringUtil.isEmpty( validationErrors ) ) {
      openErrorDialog( BaseMessages.getString( PKG, MSG_DIALOG_ERROR ), validationErrors );
      // show validation errors dialog
      return;
    }

    configureJobEntry();

    cancel();
  }

  protected void syncModel() {
    ExtTextbox tempBox =
      (ExtTextbox) getXulDomContainer().getDocumentRoot().getElementById( XUL_JOBENTRY_HADOOPJOB_NAME );
    this.hadoopJobName = ( (Text) tempBox.getTextControl() ).getText();
    tempBox = (ExtTextbox) getXulDomContainer().getDocumentRoot().getElementById( XUL_ACCESS_KEY1 );
    this.accessKey = ( (Text) tempBox.getTextControl() ).getText();
    tempBox = (ExtTextbox) getXulDomContainer().getDocumentRoot().getElementById( XUL_SECRET_KEY1 );
    this.secretKey = ( (Text) tempBox.getTextControl() ).getText();
    tempBox = (ExtTextbox) getXulDomContainer().getDocumentRoot().getElementById( XUL_JOBENTRY_HADOOPJOB_FLOW_ID );
    this.hadoopJobFlowId = ( (Text) tempBox.getTextControl() ).getText();

    tempBox = (ExtTextbox) getXulDomContainer().getDocumentRoot().getElementById( XUL_S3_STAGING_DIRECTORY );
    this.stagingDir = ( (Text) tempBox.getTextControl() ).getText();
    try {
      this.stagingDirFile = resolveFile( this.stagingDir );
    } catch ( Exception e ) {
      this.stagingDirFile = null;
    }

    tempBox = (ExtTextbox) getXulDomContainer().getDocumentRoot().getElementById( XUL_COMMAND_LINE_ARGUMENTS );
    this.cmdLineArgs = ( (Text) tempBox.getTextControl() ).getText();
    tempBox = (ExtTextbox) getXulDomContainer().getDocumentRoot().getElementById( XUL_NUM_INSTANCES1 );
    this.numInstances = ( (Text) tempBox.getTextControl() ).getText();
    tempBox = (ExtTextbox) getXulDomContainer().getDocumentRoot().getElementById( XUL_LOGGING_INTERVAL1 );
    this.loggingInterval = ( (Text) tempBox.getTextControl() ).getText();
  }

  protected String buildValidationErrorMessages() {
    String validationErrors = "";
    if ( StringUtil.isEmpty( getJobEntryName() ) ) {
      validationErrors +=
        BaseMessages.getString( PKG, MSG_AMAZON_ELASTIC_MAP_REDUCE_JOB_EXECUTOR_JOB_ENTRY_NAME_ERROR ) + "\n";
    }
    if ( StringUtil.isEmpty( getHadoopJobName() ) ) {
      validationErrors +=
        BaseMessages.getString( PKG, MSG_AMAZON_ELASTIC_MAP_REDUCE_JOB_EXECUTOR_JOB_FLOW_NAME_ERROR ) + "\n";
    }
    if ( StringUtil.isEmpty( getAccessKey() ) ) {
      validationErrors +=
        BaseMessages.getString( PKG, MSG_AMAZON_ELASTIC_MAP_REDUCE_JOB_EXECUTOR_ACCESS_KEY_ERROR ) + "\n";
    }
    if ( StringUtil.isEmpty( getSecretKey() ) ) {
      validationErrors +=
        BaseMessages.getString( PKG, MSG_AMAZON_ELASTIC_MAP_REDUCE_JOB_EXECUTOR_SECRET_KEY_ERROR ) + "\n";
    }
    String s3Protocol = S3FileProvider.SCHEME + "://";
    String sdir = getVariableSpace().environmentSubstitute( stagingDir );
    if ( StringUtil.isEmpty( getStagingDir() ) ) {
      validationErrors +=
        BaseMessages.getString( PKG, MSG_AMAZON_ELASTIC_MAP_REDUCE_JOB_EXECUTOR_STAGING_DIR_ERROR ) + "\n";
    } else if ( !sdir.startsWith( s3Protocol ) ) {
      validationErrors +=
        BaseMessages.getString( PKG, MSG_AMAZON_ELASTIC_MAP_REDUCE_JOB_EXECUTOR_STAGING_DIR_ERROR ) + "\n";
    }

    /*if (numInstances <= 0) {
      validationErrors += BaseMessages.getString(PKG, "AmazonElasticMapReduceJobExecutor.NumInstances.Error") + "\n";
    }*/
    if ( StringUtil.isEmpty( getMasterInstanceType() ) ) {
      validationErrors +=
        BaseMessages.getString( PKG, MSG_AMAZON_ELASTIC_MAP_REDUCE_JOB_EXECUTOR_MASTER_INSTANCE_TYPE_ERROR ) + "\n";
    }
    if ( StringUtil.isEmpty( getSlaveInstanceType() ) ) {
      validationErrors +=
        BaseMessages.getString( PKG, MSG_AMAZON_ELASTIC_MAP_REDUCE_JOB_EXECUTOR_SLAVE_INSTANCE_TYPE_ERROR ) + "\n";
    }
    return validationErrors;
  }

  protected void configureJobEntry() {
    // common/simple
    getJobEntry().setName( getJobEntryName() );
    getJobEntry().setHadoopJobName( getHadoopJobName() );
    getJobEntry().setHadoopJobFlowId( getHadoopJobFlowId() );
    getJobEntry().setAccessKey( getAccessKey() );
    getJobEntry().setSecretKey( getSecretKey() );
    getJobEntry().setStagingDir( getStagingDir() );
    getJobEntry().setJarUrl( getJarUrl() );
    getJobEntry().setNumInstances( getNumInstances() );
    getJobEntry().setMasterInstanceType( getMasterInstanceType() );
    getJobEntry().setSlaveInstanceType( getSlaveInstanceType() );
    getJobEntry().setCmdLineArgs( getCommandLineArgs() );
    // advanced config
    getJobEntry().setBlocking( isBlocking() );
    getJobEntry().setLoggingInterval( getLoggingInterval() );

    getJobEntry().setChanged();
  }

  public void init() {
    if ( getJobEntry() != null ) {
      // common/simple
      setName( getJobEntry().getName() );
      setJobEntryName( getJobEntry().getName() );
      setHadoopJobName( getJobEntry().getHadoopJobName() );
      setHadoopJobFlowId( getJobEntry().getHadoopJobFlowId() );
      setAccessKey( getJobEntry().getAccessKey() );
      setSecretKey( getJobEntry().getSecretKey() );
      setStagingDir( getJobEntry().getStagingDir() );
      setJarUrl( getJobEntry().getJarUrl() );
      setNumInstances( getJobEntry().getNumInstances() );
      setMasterInstanceType( getJobEntry().getMasterInstanceType() );
      setSlaveInstanceType( getJobEntry().getSlaveInstanceType() );
      setCommandLineArgs( getJobEntry().getCmdLineArgs() );
      setBlocking( getJobEntry().isBlocking() );
      setLoggingInterval( getJobEntry().getLoggingInterval() );
    }
  }

  public void cancel() {
    XulDialog xulDialog =
      (XulDialog) getXulDomContainer().getDocumentRoot().getElementById( XUL_AMAZON_EMR_JOB_ENTRY_DIALOG );
    Shell shell = (Shell) xulDialog.getRootObject();
    if ( !shell.isDisposed() ) {
      WindowProperty winprop = new WindowProperty( shell );
      PropsUI.getInstance().setScreen( winprop );
      ( (Composite) xulDialog.getManagedObject() ).dispose();
      shell.dispose();
    }
  }

  public void openErrorDialog( String title, String message ) {
    XulDialog errorDialog =
      (XulDialog) getXulDomContainer().getDocumentRoot().getElementById( XUL_AMAZON_EMR_ERROR_DIALOG );
    errorDialog.setTitle( title );

    XulTextbox errorMessage =
      (XulTextbox) getXulDomContainer().getDocumentRoot().getElementById( XUL_AMAZON_EMR_ERROR_MESSAGE );
    errorMessage.setValue( message );

    errorDialog.show();
  }

  public void closeErrorDialog() {
    XulDialog errorDialog =
      (XulDialog) getXulDomContainer().getDocumentRoot().getElementById( XUL_AMAZON_EMR_ERROR_DIALOG );
    errorDialog.hide();
  }

  protected VfsFileChooserDialog getFileChooserDialog() throws KettleFileException {
    if ( this.fileChooserDialog == null ) {
      FileObject initialFile = null;
      FileObject defaultInitialFile = KettleVFS.getFileObject( "file:///c:/" );

      VfsFileChooserDialog fileChooserDialog =
        Spoon.getInstance().getVfsFileChooserDialog( defaultInitialFile, initialFile );
      this.fileChooserDialog = fileChooserDialog;
    }
    return this.fileChooserDialog;
  }

  protected FileSystemOptions getFileSystemOptions() throws FileSystemException {
    FileSystemOptions opts = new FileSystemOptions();

    if ( !Const.isEmpty( getAccessKey() ) || !Const.isEmpty( getSecretKey() ) ) {
      // create a FileSystemOptions with user & password
      StaticUserAuthenticator userAuthenticator =
        new StaticUserAuthenticator( null,
          getVariableSpace().environmentSubstitute( getAccessKey() ),
          getVariableSpace().environmentSubstitute( getSecretKey() )
        );

      DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator( opts, userAuthenticator );
    }
    return opts;
  }

  public FileObject browse( String[] fileFilters, String[] fileFilterNames, String fileUri )
    throws KettleException, FileSystemException {
    return browse( fileFilters, fileFilterNames, fileUri, new FileSystemOptions() );
  }

  public FileObject browse( String[] fileFilters, String[] fileFilterNames, String fileUri, int fileDialogMode )
    throws KettleException, FileSystemException {
    return browse( fileFilters, fileFilterNames, fileUri, new FileSystemOptions(), fileDialogMode );
  }

  public FileObject browse( String[] fileFilters, String[] fileFilterNames, String fileUri, FileSystemOptions opts )
    throws KettleException, FileSystemException {
    return browse( fileFilters, fileFilterNames, fileUri, opts, VfsFileChooserDialog.VFS_DIALOG_OPEN_DIRECTORY );
  }

  public FileObject browse( String[] fileFilters, String[] fileFilterNames, String fileUri, FileSystemOptions opts,
                            int fileDialogMode ) throws KettleException, FileSystemException {
    return browse( fileFilters, fileFilterNames, fileUri, opts, fileDialogMode, false );
  }

  public FileObject browse( String[] fileFilters, String[] fileFilterNames, String fileUri, FileSystemOptions opts,
                            int fileDialogMode, boolean showFileScheme ) throws KettleException, FileSystemException {
    getFileChooserHelper().setShowFileScheme( showFileScheme );
    return getFileChooserHelper().browse( fileFilters, fileFilterNames, fileUri, opts, fileDialogMode );
  }

  public void browseS3StagingDir() throws KettleException, FileSystemException {
    String[] fileFilters = new String[] { "*.*" };
    String[] fileFilterNames = new String[] { "All" };

    String stagingDirText = getVariableSpace().environmentSubstitute( stagingDir );
    FileSystemOptions opts = getFileSystemOptions();

    FileObject selectedFile = browse( fileFilters, fileFilterNames, stagingDirText, opts );

    if ( selectedFile != null ) {
      setStagingDir( selectedFile.getName().getURI() );
    }
  }

  public VariableSpace getVariableSpace() {
    if ( Spoon.getInstance().getActiveTransformation() != null ) {
      return Spoon.getInstance().getActiveTransformation();
    } else if ( Spoon.getInstance().getActiveJob() != null ) {
      return Spoon.getInstance().getActiveJob();
    } else {
      return new Variables();
    }
  }

  @Override
  public String getName() {
    return "jobEntryController"; //$NON-NLS-1$
  }

  public String getJobEntryName() {
    return jobEntryName;
  }

  public void setJobEntryName( String jobEntryName ) {
    String previousVal = this.jobEntryName;
    String newVal = jobEntryName;

    this.jobEntryName = jobEntryName;
    firePropertyChange( JOB_ENTRY_NAME, previousVal, newVal );
  }

  public String getHadoopJobName() {
    return hadoopJobName;
  }

  public void setHadoopJobName( String hadoopJobName ) {
    String previousVal = this.hadoopJobName;
    String newVal = hadoopJobName;

    this.hadoopJobName = hadoopJobName;
    firePropertyChange( HADOOP_JOB_NAME, previousVal, newVal );
  }

  public String getHadoopJobFlowId() {
    return hadoopJobFlowId;
  }

  public void setHadoopJobFlowId( String hadoopJobFlowId ) {
    String previousVal = this.hadoopJobFlowId;
    String newVal = hadoopJobFlowId;

    this.hadoopJobFlowId = hadoopJobFlowId;
    firePropertyChange( HADOOP_JOB_FLOW_ID, previousVal, newVal );
  }

  public String getAccessKey() {
    return accessKey;
  }

  public void setAccessKey( String accessKey ) {
    String previousVal = this.accessKey;
    String newVal = accessKey;

    this.accessKey = accessKey;
    firePropertyChange( ACCESS_KEY, previousVal, newVal );
  }

  public String getSecretKey() {
    return secretKey;
  }

  public void setSecretKey( String secretKey ) {
    String previousVal = this.secretKey;
    String newVal = secretKey;

    this.secretKey = secretKey;
    firePropertyChange( SECRET_KEY, previousVal, newVal );
  }

  public String getStagingDir() {
    return stagingDir;
  }

  public void setStagingDir( String stagingDir ) {
    String previousVal = this.stagingDir;
    String newVal = stagingDir;

    this.stagingDir = stagingDir;
    firePropertyChange( STAGING_DIR, previousVal, newVal );
  }

  public FileObject getStagingDirFile() {
    return stagingDirFile;
  }

  public void setStagingDirFile( FileObject stagingDirFile ) {
    FileObject previousVal = this.stagingDirFile;
    FileObject newVal = stagingDirFile;

    this.stagingDirFile = stagingDirFile;
    firePropertyChange( STAGING_DIR_FILE, previousVal, newVal );
  }

  public String getJarUrl() {
    return jarUrl;
  }

  public void setJarUrl( String jarUrl ) {
    String previousVal = this.jarUrl;
    String newVal = jarUrl;

    this.jarUrl = jarUrl;
    firePropertyChange( JAR_URL, previousVal, newVal );
  }

  public String getNumInstances() {
    return numInstances;
  }

  public void setNumInstances( String numInstances ) {
    String previousVal = this.numInstances;
    String newVal = numInstances;

    this.numInstances = numInstances;
    firePropertyChange( NUM_INSTANCES, previousVal, newVal );
  }

  public String getMasterInstanceType() {
    return masterInstanceType;
  }

  public void setMasterInstanceType( String masterInstanceType ) {
    String previousVal = this.masterInstanceType;
    String newVal = masterInstanceType;

    this.masterInstanceType = masterInstanceType;
    firePropertyChange( MASTER_INSTANCE_TYPE, previousVal, newVal );
  }

  public String getSlaveInstanceType() {
    return slaveInstanceType;
  }

  public void setSlaveInstanceType( String slaveInstanceType ) {
    String previousVal = this.slaveInstanceType;
    String newVal = slaveInstanceType;

    this.slaveInstanceType = slaveInstanceType;
    firePropertyChange( SLAVE_INSTANCE_TYPE, previousVal, newVal );
  }

  public void invertBlocking() {
    setBlocking( !isBlocking() );
  }

  public abstract AbstractAmazonJobEntry getJobEntry();

  public abstract void setJobEntry( AbstractAmazonJobEntry jobEntry );

  public String getCommandLineArgs() {
    return cmdLineArgs;
  }

  public void setCommandLineArgs( String cmdLineArgs ) {
    String previousVal = this.cmdLineArgs;
    String newVal = cmdLineArgs;

    this.cmdLineArgs = cmdLineArgs;

    firePropertyChange( CMD_LINE_ARGS, previousVal, newVal );
  }

  public boolean isBlocking() {
    return blocking;
  }

  public void setBlocking( boolean blocking ) {
    boolean previousVal = this.blocking;
    boolean newVal = blocking;

    this.blocking = blocking;
    firePropertyChange( BLOCKING, previousVal, newVal );
  }

  public String getLoggingInterval() {
    return loggingInterval;
  }

  public void setLoggingInterval( String loggingInterval ) {
    String previousVal = this.loggingInterval;
    String newVal = loggingInterval;

    this.loggingInterval = loggingInterval;
    firePropertyChange( LOGGING_INTERVAL, previousVal, newVal );
  }

  public FileObject resolveFile( String fileUri ) throws FileSystemException, KettleFileException {
    VariableSpace vs = getVariableSpace();
    FileSystemOptions opts = new FileSystemOptions();
    DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(
      opts,
      new StaticUserAuthenticator( null, getAccessKey(), getSecretKey() )
    );
    FileObject file = KettleVFS.getFileObject( fileUri, vs, opts );
    return file;
  }

  protected S3VfsFileChooserHelper getFileChooserHelper() throws KettleFileException, FileSystemException {
    if ( helper == null ) {
      XulDialog xulDialog =
        (XulDialog) getXulDomContainer().getDocumentRoot().getElementById( XUL_AMAZON_EMR_JOB_ENTRY_DIALOG );
      Shell shell = (Shell) xulDialog.getRootObject();

      helper = new S3VfsFileChooserHelper( shell, getFileChooserDialog(), getVariableSpace(), getFileSystemOptions() );
    }
    return helper;
  }

  public void help() {
    JobEntryInterface jobEntry = getJobEntry();
    XulDialog xulDialog =
      (XulDialog) getXulDomContainer().getDocumentRoot().getElementById( XUL_AMAZON_EMR_JOB_ENTRY_DIALOG );
    Shell shell = (Shell) xulDialog.getRootObject();
    PluginInterface plugin =
      PluginRegistry.getInstance().findPluginWithId( JobEntryPluginType.class, jobEntry.getPluginId() );
    HelpUtils.openHelpDialog( shell, plugin );
  }

}


text: LocalStorage artigo netcoders


text:
#pragma once
#include "../itr.hpp" // definition of sstd::begin() and sstd::end()

//-----------------------------------------------------------------------------------------------------------------------------------------------

// i: int
// u: uint
// s: size_t
// b: sstd::begin()
// e: sstd::end()

//-----------------------------------------------------------------------------------------------------------------------------------------------

#define DEF_slice_empty(structName)             \
    private:                                    \
    public:                                     \
    structName(){}                              \
    ~structName(){}

#define DEF_slice_x(structName, type)           \
    private:                                    \
    public:                                     \
    type val;                                   \
    structName(type val_in): val(val_in) {}     \
    ~structName(){}

#define DEF_slice_xx(structName, lhsType, rhsType)                      \
    private:                                                            \
    public:                                                             \
    lhsType lhs;                                                        \
    rhsType rhs;                                                        \
    structName(lhsType lhs_in, rhsType rhs_in){ lhs=lhs_in; rhs=rhs_in; } \
    ~structName(){}

namespace sstd_vecSc{
    struct slice_i { DEF_slice_x (slice_i,    int); };
    struct slice_u { DEF_slice_x (slice_u,   uint); };
    struct slice_s { DEF_slice_x (slice_s, size_t); };
    struct slice_b { DEF_slice_empty(slice_b);      };
    struct slice_e { DEF_slice_empty(slice_e);      };
    struct slice_vi{ DEF_slice_x (slice_vi, const std::vector< int>&); };
    struct slice_vu{ DEF_slice_x (slice_vu, const std::vector<uint>&); };

    struct slice_ii{ DEF_slice_xx(slice_ii,    int,    int); };
    struct slice_iu{ DEF_slice_xx(slice_iu,    int,   uint); };
    struct slice_is{ DEF_slice_xx(slice_is,    int, size_t); };
    struct slice_ui{ DEF_slice_xx(slice_ui,   uint,    int); };
    struct slice_uu{ DEF_slice_xx(slice_uu,   uint,   uint); };
    struct slice_us{ DEF_slice_xx(slice_us,   uint, size_t); };
    struct slice_si{ DEF_slice_xx(slice_si, size_t,    int); };
    struct slice_su{ DEF_slice_xx(slice_su, size_t,   uint); };
    struct slice_ss{ DEF_slice_xx(slice_ss, size_t, size_t); };

    struct slice_bi{ DEF_slice_x (slice_bi,    int); };
    struct slice_bu{ DEF_slice_x (slice_bu,   uint); };
    struct slice_bs{ DEF_slice_x (slice_bs, size_t); };
    struct slice_ie{ DEF_slice_x (slice_ie,    int); };
    struct slice_ue{ DEF_slice_x (slice_ue,   uint); };
    struct slice_se{ DEF_slice_x (slice_se, size_t); };
    struct slice_be{ DEF_slice_empty(slice_be);      };

    //---

    struct slice_mv_i { DEF_slice_x (slice_mv_i,    int); };
    struct slice_mv_u { DEF_slice_x (slice_mv_u,   uint); };
    struct slice_mv_s { DEF_slice_x (slice_mv_s, size_t); };
    struct slice_mv_b { DEF_slice_empty(slice_mv_b);      };
    struct slice_mv_e { DEF_slice_empty(slice_mv_e);      };
    struct slice_mv_vi{ DEF_slice_x (slice_mv_vi, const std::vector< int>&); };
    struct slice_mv_vu{ DEF_slice_x (slice_mv_vu, const std::vector<uint>&); };

    struct slice_mv_ii{ DEF_slice_xx(slice_mv_ii,    int,    int); };
    struct slice_mv_iu{ DEF_slice_xx(slice_mv_iu,    int,   uint); };
    struct slice_mv_is{ DEF_slice_xx(slice_mv_is,    int, size_t); };
    struct slice_mv_ui{ DEF_slice_xx(slice_mv_ui,   uint,    int); };
    struct slice_mv_uu{ DEF_slice_xx(slice_mv_uu,   uint,   uint); };
    struct slice_mv_us{ DEF_slice_xx(slice_mv_us,   uint, size_t); };
    struct slice_mv_si{ DEF_slice_xx(slice_mv_si, size_t,    int); };
    struct slice_mv_su{ DEF_slice_xx(slice_mv_su, size_t,   uint); };
    struct slice_mv_ss{ DEF_slice_xx(slice_mv_ss, size_t, size_t); };

    struct slice_mv_bi{ DEF_slice_x (slice_mv_bi,    int); };
    struct slice_mv_bu{ DEF_slice_x (slice_mv_bu,   uint); };
    struct slice_mv_bs{ DEF_slice_x (slice_mv_bs, size_t); };
    struct slice_mv_ie{ DEF_slice_x (slice_mv_ie,    int); };
    struct slice_mv_ue{ DEF_slice_x (slice_mv_ue,   uint); };
    struct slice_mv_se{ DEF_slice_x (slice_mv_se, size_t); };
    struct slice_mv_be{ DEF_slice_empty(slice_mv_be);      };
}

#undef DEF_slice_empty
#undef DEF_slice_x
#undef DEF_slice_xx

//-----------------------------------------------------------------------------------------------------------------------------------------------

namespace sstd{
    sstd_vecSc::slice_i  slice(const         int val){ return sstd_vecSc::slice_i(val); }
    sstd_vecSc::slice_u  slice(const        uint val){ return sstd_vecSc::slice_u(val); }
    sstd_vecSc::slice_s  slice(const      size_t val){ return sstd_vecSc::slice_s(val); }
    sstd_vecSc::slice_b  slice(const sstd::begin val){ return sstd_vecSc::slice_b();    }
    sstd_vecSc::slice_e  slice(const sstd::end   val){ return sstd_vecSc::slice_e();    }
    sstd_vecSc::slice_vi slice(const std::vector< int>& val){ return sstd_vecSc::slice_vi(val); }
    sstd_vecSc::slice_vu slice(const std::vector<uint>& val){ return sstd_vecSc::slice_vu(val); }

    sstd_vecSc::slice_ii slice(const         int lhs, const       int rhs){ return sstd_vecSc::slice_ii(lhs, rhs); }
    sstd_vecSc::slice_iu slice(const         int lhs, const      uint rhs){ return sstd_vecSc::slice_iu(lhs, rhs); }
    sstd_vecSc::slice_is slice(const         int lhs, const    size_t rhs){ return sstd_vecSc::slice_is(lhs, rhs); }
    sstd_vecSc::slice_ui slice(const        uint lhs, const       int rhs){ return sstd_vecSc::slice_ui(lhs, rhs); }
    sstd_vecSc::slice_uu slice(const        uint lhs, const      uint rhs){ return sstd_vecSc::slice_uu(lhs, rhs); }
    sstd_vecSc::slice_us slice(const        uint lhs, const    size_t rhs){ return sstd_vecSc::slice_us(lhs, rhs); }
    sstd_vecSc::slice_si slice(const      size_t lhs, const       int rhs){ return sstd_vecSc::slice_si(lhs, rhs); }
    sstd_vecSc::slice_su slice(const      size_t lhs, const      uint rhs){ return sstd_vecSc::slice_su(lhs, rhs); }
    sstd_vecSc::slice_ss slice(const      size_t lhs, const    size_t rhs){ return sstd_vecSc::slice_ss(lhs, rhs); }

    sstd_vecSc::slice_bi slice(const sstd::begin lhs, const       int rhs){ return sstd_vecSc::slice_bi(rhs); }
    sstd_vecSc::slice_bu slice(const sstd::begin lhs, const      uint rhs){ return sstd_vecSc::slice_bu(rhs); }
    sstd_vecSc::slice_bs slice(const sstd::begin lhs, const    size_t rhs){ return sstd_vecSc::slice_bs(rhs); }
    sstd_vecSc::slice_ie slice(const         int lhs, const sstd::end rhs){ return sstd_vecSc::slice_ie(lhs); }
    sstd_vecSc::slice_ue slice(const        uint lhs, const sstd::end rhs){ return sstd_vecSc::slice_ue(lhs); }
    sstd_vecSc::slice_se slice(const      size_t lhs, const sstd::end rhs){ return sstd_vecSc::slice_se(lhs); }
    sstd_vecSc::slice_be slice(const sstd::begin lhs, const sstd::end rhs){ return sstd_vecSc::slice_be();    }

    //---

    sstd_vecSc::slice_mv_i  slice_mv(const         int val){ return sstd_vecSc::slice_mv_i(val); }
    sstd_vecSc::slice_mv_u  slice_mv(const        uint val){ return sstd_vecSc::slice_mv_u(val); }
    sstd_vecSc::slice_mv_s  slice_mv(const      size_t val){ return sstd_vecSc::slice_mv_s(val); }
    sstd_vecSc::slice_mv_b  slice_mv(const sstd::begin val){ return sstd_vecSc::slice_mv_b();    }
    sstd_vecSc::slice_mv_e  slice_mv(const sstd::end   val){ return sstd_vecSc::slice_mv_e();    }
    sstd_vecSc::slice_mv_vi slice_mv(const std::vector< int>& val){ return sstd_vecSc::slice_mv_vi(val); }
    sstd_vecSc::slice_mv_vu slice_mv(const std::vector<uint>& val){ return sstd_vecSc::slice_mv_vu(val); }

    sstd_vecSc::slice_mv_ii slice_mv(const         int lhs, const       int rhs){ return sstd_vecSc::slice_mv_ii(lhs, rhs); }
    sstd_vecSc::slice_mv_iu slice_mv(const         int lhs, const      uint rhs){ return sstd_vecSc::slice_mv_iu(lhs, rhs); }
    sstd_vecSc::slice_mv_is slice_mv(const         int lhs, const    size_t rhs){ return sstd_vecSc::slice_mv_is(lhs, rhs); }
    sstd_vecSc::slice_mv_ui slice_mv(const        uint lhs, const       int rhs){ return sstd_vecSc::slice_mv_ui(lhs, rhs); }
    sstd_vecSc::slice_mv_uu slice_mv(const        uint lhs, const      uint rhs){ return sstd_vecSc::slice_mv_uu(lhs, rhs); }
    sstd_vecSc::slice_mv_us slice_mv(const        uint lhs, const    size_t rhs){ return sstd_vecSc::slice_mv_us(lhs, rhs); }
    sstd_vecSc::slice_mv_si slice_mv(const      size_t lhs, const       int rhs){ return sstd_vecSc::slice_mv_si(lhs, rhs); }
    sstd_vecSc::slice_mv_su slice_mv(const      size_t lhs, const      uint rhs){ return sstd_vecSc::slice_mv_su(lhs, rhs); }
    sstd_vecSc::slice_mv_ss slice_mv(const      size_t lhs, const    size_t rhs){ return sstd_vecSc::slice_mv_ss(lhs, rhs); }

    sstd_vecSc::slice_mv_bi slice_mv(const sstd::begin lhs, const       int rhs){ return sstd_vecSc::slice_mv_bi(rhs); }
    sstd_vecSc::slice_mv_bu slice_mv(const sstd::begin lhs, const      uint rhs){ return sstd_vecSc::slice_mv_bu(rhs); }
    sstd_vecSc::slice_mv_bs slice_mv(const sstd::begin lhs, const    size_t rhs){ return sstd_vecSc::slice_mv_bs(rhs); }
    sstd_vecSc::slice_mv_ie slice_mv(const         int lhs, const sstd::end rhs){ return sstd_vecSc::slice_mv_ie(lhs); }
    sstd_vecSc::slice_mv_ue slice_mv(const        uint lhs, const sstd::end rhs){ return sstd_vecSc::slice_mv_ue(lhs); }
    sstd_vecSc::slice_mv_se slice_mv(const      size_t lhs, const sstd::end rhs){ return sstd_vecSc::slice_mv_se(lhs); }
    sstd_vecSc::slice_mv_be slice_mv(const sstd::begin lhs, const sstd::end rhs){ return sstd_vecSc::slice_mv_be();    }
}

//-----------------------------------------------------------------------------------------------------------------------------------------------

#define int2loc(i) /* integer2location */       \
    if(i<0){ i+=(int)vec.size(); }
#define DEF_slice_x_base(CAST_VAL, valLoc)                          \
    std::vector<T> ret = std::vector<T>{ (CAST_VAL)(vec[valLoc]) };
#define DEF_slice_xx_base(CAST_VAL, lhsLoc, rhsLoc)                     \
    std::vector<T> ret((uint)rhsLoc-(uint)lhsLoc);                      \
    for(uint r=0, i=(uint)lhsLoc; i<(uint)rhsLoc; ++r,++i){ ret[r] = (CAST_VAL)(vec[i]); }
#define DEF_slice_i_index_base(CAST_VAL, val)                           \
    std::vector<T> ret(val.size()); for(uint i=0; i<val.size(); ++i){  int idx=val[i]; int2loc(idx); ret[i]=(CAST_VAL)(vec[idx]); }
#define DEF_slice_u_index_base(CAST_VAL, val)                           \
    std::vector<T> ret(val.size()); for(uint i=0; i<val.size(); ++i){ uint idx=val[i];               ret[i]=(CAST_VAL)(vec[idx]); }

template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_i  s){ int2loc(s.val); DEF_slice_x_base(T,        s.val); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_u  s){                 DEF_slice_x_base(T,        s.val); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_s  s){                 DEF_slice_x_base(T,        s.val); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_b  s){                 DEF_slice_x_base(T,      (uint)0); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_e  s){                 DEF_slice_x_base(T, vec.size()-1); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_vi s){                 DEF_slice_i_index_base(T,  s.val); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_vu s){                 DEF_slice_u_index_base(T,  s.val); return ret; }

template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_ii s){ int2loc(s.lhs); int2loc(s.rhs); DEF_slice_xx_base(T, s.lhs, s.rhs); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_iu s){ int2loc(s.lhs);                 DEF_slice_xx_base(T, s.lhs, s.rhs); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_is s){ int2loc(s.lhs);                 DEF_slice_xx_base(T, s.lhs, s.rhs); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_ui s){                 int2loc(s.rhs); DEF_slice_xx_base(T, s.lhs, s.rhs); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_uu s){                                 DEF_slice_xx_base(T, s.lhs, s.rhs); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_us s){                                 DEF_slice_xx_base(T, s.lhs, s.rhs); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_si s){                 int2loc(s.rhs); DEF_slice_xx_base(T, s.lhs, s.rhs); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_su s){                                 DEF_slice_xx_base(T, s.lhs, s.rhs); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_ss s){                                 DEF_slice_xx_base(T, s.lhs, s.rhs); return ret; }

template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_bi s){                 int2loc(s.val); DEF_slice_xx_base(T, (uint)0,      s.val); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_bu s){                                 DEF_slice_xx_base(T, (uint)0,      s.val); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_bs s){                                 DEF_slice_xx_base(T, (uint)0,      s.val); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_ie s){ int2loc(s.val);                 DEF_slice_xx_base(T,   s.val, vec.size()); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_ue s){                                 DEF_slice_xx_base(T,   s.val, vec.size()); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_se s){                                 DEF_slice_xx_base(T,   s.val, vec.size()); return ret; }
template <typename T> inline std::vector<T> operator&&(const std::vector<T>& vec, sstd_vecSc::slice_be s){                                 DEF_slice_xx_base(T, (uint)0, vec.size()); return ret; }

//---

template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_i  s){ int2loc(s.val); DEF_slice_x_base(std::move,        s.val); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_u  s){                 DEF_slice_x_base(std::move,        s.val); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_s  s){                 DEF_slice_x_base(std::move,        s.val); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_b  s){                 DEF_slice_x_base(std::move,      (uint)0); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_e  s){                 DEF_slice_x_base(std::move, vec.size()-1); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_vi s){                 DEF_slice_i_index_base(std::move,  s.val); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_vu s){                 DEF_slice_u_index_base(std::move,  s.val); return ret; }

template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_ii s){ int2loc(s.lhs); int2loc(s.rhs); DEF_slice_xx_base(std::move, s.lhs, s.rhs); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_iu s){ int2loc(s.lhs);                 DEF_slice_xx_base(std::move, s.lhs, s.rhs); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_is s){ int2loc(s.lhs);                 DEF_slice_xx_base(std::move, s.lhs, s.rhs); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_ui s){                 int2loc(s.rhs); DEF_slice_xx_base(std::move, s.lhs, s.rhs); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_uu s){                                 DEF_slice_xx_base(std::move, s.lhs, s.rhs); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_us s){                                 DEF_slice_xx_base(std::move, s.lhs, s.rhs); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_si s){                 int2loc(s.rhs); DEF_slice_xx_base(std::move, s.lhs, s.rhs); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_su s){                                 DEF_slice_xx_base(std::move, s.lhs, s.rhs); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_ss s){                                 DEF_slice_xx_base(std::move, s.lhs, s.rhs); return ret; }

template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_bi s){                 int2loc(s.val); DEF_slice_xx_base(std::move, (uint)0,      s.val); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_bu s){                                 DEF_slice_xx_base(std::move, (uint)0,      s.val); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_bs s){                                 DEF_slice_xx_base(std::move, (uint)0,      s.val); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_ie s){ int2loc(s.val);                 DEF_slice_xx_base(std::move,   s.val, vec.size()); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_ue s){                                 DEF_slice_xx_base(std::move,   s.val, vec.size()); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_se s){                                 DEF_slice_xx_base(std::move,   s.val, vec.size()); return ret; }
template <typename T> inline std::vector<T> operator&&(      std::vector<T>& vec, sstd_vecSc::slice_mv_be s){                                 DEF_slice_xx_base(std::move, (uint)0, vec.size()); return ret; }

#undef DEF_slice_u_index_base
#undef DEF_slice_i_index_base
#undef DEF_slice_xx_base
#undef DEF_slice_x_base
#undef int2len

//-----------------------------------------------------------------------------------------------------------------------------------------------


text:
body {
	width: 640px;
	font-family:sans-serif;
	font-size:14px;
/*	border:1px solid black; */
}

.header {
	width: 576px;
	margin-bottom: 20px;
	margin-left: 5%;
	margin-right: 5%;
/*	border:1px solid black; */
}

.headline {
	text-align:center;
/*	border:1px solid black; */
}

.body {
	width:576px;
	margin-left: 5%;
	margin-right: 5%;
/*	border:1px solid black; */
}

.contentbox {
	margin-left:auto;
	margin-right:auto;
	margin-top: 20px;
	border:0px solid black;
}
.globTD {

	border-left:1px solid silver;
	border-right:1px solid silver;
	width:576px;
	height:100%;
}

.QABox {
	margin-top: 15px;
	margin-bottom: 15px;
	width: 500px;
}

.question {
	font-weight: bold;
}

.answer {
	font-style:italic;
}

.textbox {
	margin-left:30px;
}

.bodyhr {
	height: 1px;
	width: 415px;
	color:silver;
	background-color:silver;
	margin-left:30px;

}

.createbox {
/*	border:1px solid black; */
	margin-top: 20px;
	margin-bottom: 10px;
	margin-left:30px;
}

.deletebox {
/*	border:1px solid black; */
	margin-top: 20px;
	margin-bottom: 10px;
}

.inputtitletd {
	width: 100px;
}

.resolvebox {
/*	border:1px solid black; */
	margin-top: 10px;
	margin-bottom: 20px;
	margin-left:30px;
}

.footer {
	width:576px;
	margin-left: 5%;
	margin-right: 5%;
	margin-top: 20px;
	font-size:12px;
/*	border:1px solid black; */
}

/*
This is just rounded corner stuff for the main frame
*/
.table {width:50%; margin:20px 0px 0px 20px;border:0px solid light-gray;}
.cnptransactbl { margin:20px 0px 0px 20px; }
.cnpdescrp { margin:20px 0px 0px 20px; }
*	{
	margin: 0px;
	padding: 0px;
}
.tr { background:white; border:0px solid black;}
.tdtitle { padding:0px 0px 0px 10px;border:0px solid black; width:20%;border-left:1px solid silver;}
.tdvalue { padding:0px 0px 0px 0px;border:0px solid black; width:80%;border-right:1px solid silver;}
.rrcorner{display:block}
.rrcorner *{display:block;height:1px;overflow:hidden;font-size:.01em;background:white}
.rrcorner1{margin-left:3px;margin-right:3px;padding-left:1px;padding-right:1px;border-left:1px solid silver;border-top:1px solid silver;border-right:1px solid silver;background:white}
.rrcorner2{margin-left:1px;margin-right:1px;padding-right:1px;padding-left:1px;border-left:1px solid silver;border-right:1px solid silver;background:white}
.rrcorner3{margin-left:1px;margin-right:1px;border-left:1px solid silver;border-right:1px solid silver;}
.rrcorner4{border-left:1px solid silver;border-right:1px solid silver}
.rrcorner5{border-left:1px solid silver;border-right:1px solid silver}