Class BsonUtils


  • public class BsonUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <V> java.util.Optional<V> first​(java.util.Optional<V>... values)  
      static java.util.Optional<org.bson.BsonValue> get​(org.bson.BsonDocument doc, java.lang.String... path)  
      static java.util.Optional<java.lang.Iterable<org.bson.BsonValue>> getArray​(org.bson.BsonDocument doc, java.lang.String... path)  
      static java.util.Optional<java.lang.Boolean> getBool​(org.bson.BsonDocument doc, java.lang.String... path)  
      static java.util.Optional<org.bson.BsonDocument> getDocument​(org.bson.BsonDocument doc, java.lang.String... path)  
      static java.util.Optional<java.lang.Double> getDouble​(org.bson.BsonDocument doc, java.lang.String... path)  
      static java.util.Optional<java.lang.Integer> getInt32​(org.bson.BsonDocument doc, java.lang.String... path)  
      static java.util.Optional<java.lang.Long> getInt64​(org.bson.BsonDocument doc, java.lang.String... path)  
      static java.util.Optional<java.lang.String> getString​(org.bson.BsonDocument doc, java.lang.String... path)  
      static java.util.Optional<java.time.Instant> getTime​(org.bson.BsonDocument doc, java.lang.String... path)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • get

        public static java.util.Optional<org.bson.BsonValue> get​(org.bson.BsonDocument doc,
                                                                 java.lang.String... path)
      • getInt64

        public static java.util.Optional<java.lang.Long> getInt64​(org.bson.BsonDocument doc,
                                                                  java.lang.String... path)
      • getDouble

        public static java.util.Optional<java.lang.Double> getDouble​(org.bson.BsonDocument doc,
                                                                     java.lang.String... path)
      • getInt32

        public static java.util.Optional<java.lang.Integer> getInt32​(org.bson.BsonDocument doc,
                                                                     java.lang.String... path)
      • getString

        public static java.util.Optional<java.lang.String> getString​(org.bson.BsonDocument doc,
                                                                     java.lang.String... path)
      • getBool

        public static java.util.Optional<java.lang.Boolean> getBool​(org.bson.BsonDocument doc,
                                                                    java.lang.String... path)
      • getArray

        public static java.util.Optional<java.lang.Iterable<org.bson.BsonValue>> getArray​(org.bson.BsonDocument doc,
                                                                                          java.lang.String... path)
      • getDocument

        public static java.util.Optional<org.bson.BsonDocument> getDocument​(org.bson.BsonDocument doc,
                                                                            java.lang.String... path)
      • first

        public static <V> java.util.Optional<V> first​(java.util.Optional<V>... values)
      • getTime

        public static java.util.Optional<java.time.Instant> getTime​(org.bson.BsonDocument doc,
                                                                    java.lang.String... path)