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

com.github.apuex.springbootsolution.runtime.Message.scala Maven / Gradle / Ivy

package com.github.apuex.springbootsolution.runtime

import java.util

object Message {
  def createConnection(connectionType: LogicalConnectionType, predicates: java.util.List[FilterPredicate]): FilterPredicate = {
    val connection = LogicalConnectionVo.newBuilder()
      .setLogicalConnectionType(connectionType)
      .addAllPredicates(predicates)
      .build()

    FilterPredicate.newBuilder()
      .setConnection(connection)
      .build()
  }

  def createPredicate(predicateType: PredicateType, name: String, value: String, params: util.Map[String, String]): FilterPredicate = {
    val paramNames = new util.ArrayList[String]
    paramNames.add(name)
    val predicateVo = LogicalPredicateVo.newBuilder()
      .setPredicateType(predicateType)
      .setFieldName(name)
      .addAllParamNames(paramNames)
      .build()

    val predicate = FilterPredicate.newBuilder()
      .setPredicate(predicateVo)
      .build()

    params.put(name, value)

    predicate
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy