code: public static Double stLength3D(Geometry geom) {
          if (geom == null) {
              return null;
          }
          if(geom instanceof LineString || geom instanceof MultiLineString){
              return length3D(geom);
          }
          return 0.0D;
      }
docs: Returns the 3D length (of a LineString or MultiLineString) ortherwise 0.
  
  @param geom Geometry
  @return The 3D length (of a LineString or MultiLineString) ortherwise 0