def assertValidProp[A]()

in s2core/src/main/scala/org/apache/s2graph/core/S2Property.scala [82:102]


  def assertValidProp[A](key: Any, value: A): Unit = {
    if (key == null) throw Property.Exceptions.propertyKeyCanNotBeEmpty()
    if (!key.isInstanceOf[String]) throw Element.Exceptions.providedKeyValuesMustHaveALegalKeyOnEvenIndices()

    if (value == null) throw Property.Exceptions.propertyValueCanNotBeNull()
    if (!validType(value)) {
     value match {
       case _: java.io.Serializable => throw Property.Exceptions.dataTypeOfPropertyValueNotSupported(value)
       case _ =>
     }
    }

    if (value.isInstanceOf[Iterable[_]]) throw new java.lang.IllegalArgumentException("not supported data type")
    if (value.isInstanceOf[Array[_]]) throw new java.lang.IllegalArgumentException("not supported data type")
    if (value.isInstanceOf[java.util.List[_]]) throw new java.lang.IllegalArgumentException("not supported data type")
    if (value.isInstanceOf[java.util.Map[_, _]]) throw new java.lang.IllegalArgumentException("not supported data type")

    if (key.toString.isEmpty) throw Property.Exceptions.propertyKeyCanNotBeEmpty()
    if (Graph.Hidden.isHidden(key.toString)) throw Property.Exceptions.propertyKeyCanNotBeAHiddenKey(Graph.Hidden.hide(key.toString))

  }