All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.scalar.db.sql.common.EmptyColumnDefinitions Maven / Gradle / Ivy

There is a newer version: 3.14.0
Show newest version
package com.scalar.db.sql.common;

import com.scalar.db.sql.ColumnDefinition;
import com.scalar.db.sql.ColumnDefinitions;
import java.util.Collections;
import java.util.Set;

public enum EmptyColumnDefinitions implements ColumnDefinitions {
  INSTANCE;

  @Override
  public ColumnDefinition getColumnDefinition(String columnName) {
    throw new IllegalArgumentException(SqlError.COLUMN_NOT_FOUND.buildMessage(columnName));
  }

  @Override
  public ColumnDefinition getColumnDefinition(int i) {
    throw new IndexOutOfBoundsException(SqlError.COLUMN_INDEX_OUT_OF_BOUNDS.buildMessage(i, 0));
  }

  @Override
  public boolean contains(String columnName) {
    return false;
  }

  @Override
  public Set getColumnNames() {
    return Collections.emptySet();
  }

  @Override
  public int size() {
    return 0;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy