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

com.rapid7.armor.meta.ShardMetadata Maven / Gradle / Ivy

There is a newer version: 0.0.52
Show newest version
package com.rapid7.armor.meta;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.rapid7.armor.schema.ColumnId;
import com.rapid7.armor.shard.ShardId;

import java.util.List;
import java.util.stream.Collectors;

@JsonInclude(value = Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ShardMetadata {

  private List columnMetadatas;
  private ShardId shardId;

  public ShardMetadata() {} 
  
  public ShardMetadata(ShardId shardId, List columnMetadatas) {
    this.shardId = shardId;
    this.columnMetadatas = columnMetadatas;
  }

  public List getColumnMetadata() {
    return columnMetadatas;
  }

  public void setColumnMetadata(List columnMetadata) {
    this.columnMetadatas = columnMetadata;
  }
  
  public ShardId setShardId(ShardId shardId) {
    return shardId;
  }

  public ShardId getShardId() {
    return shardId;
  }
  
  public List columnIds() {
    return columnMetadatas.stream()
        .filter(c -> c != null)
        .map(c -> new ColumnId(c.getColumnName(), c.getColumnType().getCode()))
        .collect(Collectors.toList()); 
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy