Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added braces

  • Loading branch information...
commit 4ee2f8254e026cb21d9904c6a5c4cdd744ad5d77 1 parent 648c21a
@sjoerdmulder sjoerdmulder authored
Showing with 20 additions and 10 deletions.
  1. +20 −10 src/main/org/bson/types/Binary.java
View
30 src/main/org/bson/types/Binary.java
@@ -27,7 +27,7 @@
import java.util.Arrays;
/**
- generic binary holder
+ * generic binary holder
*/
public class Binary implements Serializable {
@@ -35,43 +35,53 @@
/**
* Creates a Binary object with the default binary type of 0
+ *
* @param data raw data
*/
- public Binary( byte[] data ){
+ public Binary(byte[] data) {
this(BSON.B_GENERAL, data);
}
/**
* Creates a Binary object
+ *
* @param type type of the field as encoded in BSON
* @param data raw data
*/
- public Binary( byte type , byte[] data ){
+ public Binary(byte type, byte[] data) {
_type = type;
_data = data;
}
- public byte getType(){
+ public byte getType() {
return _type;
}
- public byte[] getData(){
+ public byte[] getData() {
return _data;
}
- public int length(){
+ public int length() {
return _data.length;
}
@Override
public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof Binary)) return false;
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof Binary)) {
+ return false;
+ }
Binary binary = (Binary) o;
- if (_type != binary._type) return false;
- if (!Arrays.equals(_data, binary._data)) return false;
+ if (_type != binary._type) {
+ return false;
+ }
+ if (!Arrays.equals(_data, binary._data)) {
+ return false;
+ }
return true;
}
Please sign in to comment.
Something went wrong with that request. Please try again.