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

org.sisioh.aws4s.dynamodb.document.RichTableKeysAndAttributes.scala Maven / Gradle / Ivy

There is a newer version: 1.0.16
Show newest version
package org.sisioh.aws4s.dynamodb.document

import com.amazonaws.services.dynamodbv2.document.{ PrimaryKey, TableKeysAndAttributes }
import org.sisioh.aws4s.PimpedType

import scala.collection.JavaConverters._

object TableKeysAndAttributeFactory {

  def apply(tableName: String): TableKeysAndAttributes = new TableKeysAndAttributes(tableName)

}

class RichTableKeysAndAttributes(val underlying: TableKeysAndAttributes) extends AnyVal with PimpedType[TableKeysAndAttributes] {

  def primaryKeys: Seq[PrimaryKey] = underlying.getPrimaryKeys.asScala.toVector

  def withAttributeNames(attributeNames: Seq[String]): TableKeysAndAttributes = underlying.withAttributeNames(attributeNames.asJava)

  def attributeNames: Set[String] = underlying.getAttributeNames.asScala.toSet

  def tableName: String = underlying.getTableName

  def projectionExpression: String = underlying.getProjectionExpression

  def nameMap: Map[String, String] = underlying.getNameMap.asScala.toMap

  def withNameMap(nameMap: Map[String, String]): TableKeysAndAttributes = underlying.withNameMap(nameMap.asJava)

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy