// Path: src/util/src/main/java/org/lilycms/util/ArgumentValidator.java
// public class ArgumentValidator {
//     public static void notNull(Object object, String argName) {
//         if (object == null)
//             throw new IllegalArgumentException("Null argument: " + argName);
//     }
// }


import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.node.JsonNodeFactory;
import org.codehaus.jackson.node.ObjectNode;
import org.lilycms.util.ArgumentValidator;
import java.lang.reflect.Constructor;
import java.util.*;
/*
 * Copyright 2010 Outerthought bvba
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.lilycms.hbaseindex;



/**
 * Defines the structure of an index.
 *
 * <p>An index is defined by instantiating an object of this class, adding one
 * or more fields to it using the methods like {@link #addStringField},
 * {@link #addIntegerField}, etc. Finally the index is created by calling
 * {@link IndexManager#createIndex}. After creation, the definition of an index
 * cannot be modified.
 */
public class IndexDefinition {
  private String table;
  private String name;
  private List<IndexFieldDefinition> fields = new ArrayList<IndexFieldDefinition>();
  private Map<String, IndexFieldDefinition> fieldsByName = new HashMap<String, IndexFieldDefinition>();
  private Order identifierOrder = Order.ASCENDING;

  public IndexDefinition(String table, String name) {
// Path: src/util/src/main/java/org/lilycms/util/ArgumentValidator.java
// public class ArgumentValidator {
//     public static void notNull(Object object, String argName) {
//         if (object == null)
//             throw new IllegalArgumentException("Null argument: " + argName);
//     }
// }


// Path: src/hbaseindex/src/main/java/org/lilycms/hbaseindex/IndexDefinition.java
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.node.JsonNodeFactory;
import org.codehaus.jackson.node.ObjectNode;
import org.lilycms.util.ArgumentValidator;
import java.lang.reflect.Constructor;
import java.util.*;

/*
 * Copyright 2010 Outerthought bvba
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.lilycms.hbaseindex;



/**
 * Defines the structure of an index.
 *
 * <p>An index is defined by instantiating an object of this class, adding one
 * or more fields to it using the methods like {@link #addStringField},
 * {@link #addIntegerField}, etc. Finally the index is created by calling
 * {@link IndexManager#createIndex}. After creation, the definition of an index
 * cannot be modified.
 */
public class IndexDefinition {
  private String table;
  private String name;
  private List<IndexFieldDefinition> fields = new ArrayList<IndexFieldDefinition>();
  private Map<String, IndexFieldDefinition> fieldsByName = new HashMap<String, IndexFieldDefinition>();
  private Order identifierOrder = Order.ASCENDING;

  public IndexDefinition(String table, String name) {
    ArgumentValidator.notNull(name, "table");