incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From twilli...@apache.org
Subject [1/4] git commit: allow user defined defaults on the blur object
Date Tue, 23 Sep 2014 02:56:10 GMT
Repository: incubator-blur
Updated Branches:
  refs/heads/master e4153554b -> 2a61bb5d6


allow user defined defaults on the blur object


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/76e79b58
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/76e79b58
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/76e79b58

Branch: refs/heads/master
Commit: 76e79b5822a607b630bf01894411b44b16a4fe42
Parents: e415355
Author: twilliams <twilliams@apache.org>
Authored: Mon Sep 22 20:30:10 2014 -0400
Committer: twilliams <twilliams@apache.org>
Committed: Mon Sep 22 20:30:10 2014 -0400

----------------------------------------------------------------------
 .../org/apache/blur/command/BlurObject.java     | 56 ++++++++++++++++++++
 1 file changed, 56 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/76e79b58/blur-core/src/main/java/org/apache/blur/command/BlurObject.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/command/BlurObject.java b/blur-core/src/main/java/org/apache/blur/command/BlurObject.java
index 139c7de..50bec26 100644
--- a/blur-core/src/main/java/org/apache/blur/command/BlurObject.java
+++ b/blur-core/src/main/java/org/apache/blur/command/BlurObject.java
@@ -47,6 +47,13 @@ public class BlurObject {
     return (String) _valueMap.get(name);
   }
 
+  public String getString(String name, String defaultVal) {
+    if (!_valueMap.containsKey(name)) {
+      return defaultVal;
+    }
+    return getString(name);
+  }
+
   public void accumulate(String name, Integer value) {
     accumulate(name, (Object) value);
   }
@@ -59,6 +66,13 @@ public class BlurObject {
     return (Integer) _valueMap.get(name);
   }
 
+  public Integer getInteger(String name, Integer defaultVal) {
+    if (!_valueMap.containsKey(name)) {
+      return defaultVal;
+    }
+    return getInteger(name);
+  }
+
   public void accumulate(String name, Short value) {
     accumulate(name, (Object) value);
   }
@@ -71,6 +85,13 @@ public class BlurObject {
     return (Short) _valueMap.get(name);
   }
 
+  public Short getShort(String name, Short defaultVal) {
+    if (!_valueMap.containsKey(name)) {
+      return defaultVal;
+    }
+    return getShort(name);
+  }
+
   public void accumulate(String name, Long value) {
     accumulate(name, (Object) value);
   }
@@ -83,6 +104,13 @@ public class BlurObject {
     return (Long) _valueMap.get(name);
   }
 
+  public Long getLong(String name, Long defaultVal) {
+    if (!_valueMap.containsKey(name)) {
+      return defaultVal;
+    }
+    return getLong(name);
+  }
+
   public void accumulate(String name, Double value) {
     accumulate(name, (Object) value);
   }
@@ -95,6 +123,13 @@ public class BlurObject {
     return (Double) _valueMap.get(name);
   }
 
+  public Double getDouble(String name, Double defaultVal) {
+    if (!_valueMap.containsKey(name)) {
+      return defaultVal;
+    }
+    return getDouble(name);
+  }
+
   public void accumulate(String name, Float value) {
     accumulate(name, (Object) value);
   }
@@ -107,6 +142,13 @@ public class BlurObject {
     return (Float) _valueMap.get(name);
   }
 
+  public Float getFloat(String name, Float defaultVal) {
+    if (!_valueMap.containsKey(name)) {
+      return defaultVal;
+    }
+    return getFloat(name);
+  }
+
   public void accumulate(String name, byte[] value) {
     accumulate(name, (Object) value);
   }
@@ -119,6 +161,13 @@ public class BlurObject {
     return (byte[]) _valueMap.get(name);
   }
 
+  public byte[] getBinary(String name, byte[] defaultVal) {
+    if (!_valueMap.containsKey(name)) {
+      return defaultVal;
+    }
+    return getBinary(name);
+  }
+
   public void accumulate(String name, Boolean value) {
     accumulate(name, (Object) value);
   }
@@ -131,6 +180,13 @@ public class BlurObject {
     return (Boolean) _valueMap.get(name);
   }
 
+  public Boolean getBoolean(String name, Boolean defaultVal) {
+    if (!_valueMap.containsKey(name)) {
+      return defaultVal;
+    }
+    return getBoolean(name);
+  }
+
   public void accumulate(String name, BlurObject value) {
     accumulate(name, (Object) value);
   }


Mime
View raw message