Skip to content

Commit

Permalink
Merge branch 'ConfNet' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanLindel committed Nov 6, 2017
2 parents e9255bf + c08e713 commit e18a21f
Show file tree
Hide file tree
Showing 34 changed files with 707 additions and 238 deletions.
3 changes: 3 additions & 0 deletions src/main/java/de/uniks/networkparser/DateTimeEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,9 @@ public String toString(String dateFormat) {

@Override
public String toString() {
if(this.isDirty()) {
this.calculate();
}
return this.fields.get(DateField.DAY_OF_MONTH) + "."
+ this.fields.get(DateField.MONTH) + "."
+ this.fields.get(DateField.YEAR);
Expand Down
96 changes: 51 additions & 45 deletions src/main/java/de/uniks/networkparser/Filter.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,25 @@ public class Filter {
/** The Constant COLLISION. */
public static final String COLLISION = "collision";

public static final Filter SIMPLEFORMAT = new Filter().withSimpleFormat(true);

protected ObjectCondition idFilter;
protected ObjectCondition convertable; // Or Notification for Decode
protected ObjectCondition property;

private static final int FORMAT_REFERENCE=0;
private static final int FORMAT_NULL=1;
private static final int FORMAT_FULL=2;
private static final int FORMAT_TYPESAVE=3;
// Entweder eines der unteren Formate
protected static final byte FORMAT_NULL=1;
protected static final byte FORMAT_FULL=2;
protected static final byte FORMAT_TYPESAVE=3;

protected static final byte FORMAT_SHORTCLASS=4;
/**
* Format
* 0= REFERENCE
* 1 = NULL-Check
* 2 = FULL
* 3 = TYPESAVE
*/
private int format; // FORMAT:
private byte format; // FORMAT:

// Temporary variables
private String strategy = SendableEntityCreator.NEW;
Expand Down Expand Up @@ -97,50 +98,28 @@ public boolean isSimpleFormat(Object entity, SendableEntityCreator creator, Stri
* @return boolean for serialization the full object
*/
public boolean isFullSerialization() {
return format>=FORMAT_FULL;
return (format % FORMAT_SHORTCLASS)>=FORMAT_FULL;
}

public boolean isTypSave() {
return format>=FORMAT_TYPESAVE;
}

public boolean isReferenceCheck() {
return format>=FORMAT_REFERENCE;
return (format % FORMAT_SHORTCLASS)>=FORMAT_TYPESAVE;
}

public boolean isNullCheck() {
return format>=FORMAT_NULL;
return (format % FORMAT_SHORTCLASS)>=FORMAT_NULL;
}

/**
* Serialization the Full object inclusive null value
* @param value for serialization the full object
* @return self instance
*/
public Filter withFull(boolean value) {
if(value) {
if(format<FORMAT_FULL) {
format = FORMAT_FULL;
}
} else if(format>=FORMAT_FULL) {
format = FORMAT_NULL;
}
return this;
public boolean isShortClass() {
return format >= FORMAT_SHORTCLASS;
}

/**
* Serialization the Full object inclusive null value
* @param value for serialization the full object
* @param format for serialization the full object
* @return self instance
*/
public Filter withNullCheck(boolean value) {
if(value) {
if(format<FORMAT_NULL) {
format = FORMAT_NULL;
}
} else if(format>=FORMAT_NULL) {
format = FORMAT_REFERENCE;
}
public Filter withFormat(byte format) {
this.format = format;
return this;
}

Expand Down Expand Up @@ -209,15 +188,6 @@ public static Filter convertable(ObjectCondition convertable) {
return new Filter().withConvertable(convertable);
}


/**
* Full Serialization
* @return a Filter for Full Serialization
*/
public static Filter createFull() {
return new Filter().withFull(true);
}

public String[] getProperties(SendableEntityCreator creator) {
return creator.getProperties();
}
Expand Down Expand Up @@ -247,4 +217,40 @@ public Filter withSimpleFormat(boolean value) {
public void suspendNotification() {
this.strategy = SendableEntityCreator.UPDATE;
}


/**
* Full Serialization
* @return a Filter for Full Serialization
*/
public static Filter createFull() {
return new Filter().withFormat(FORMAT_FULL);
}

/**
* Simple Serialization
* @return a Filter for Simple Serialization
*/
public static Filter createSimple() {
return new Filter().withSimpleFormat(true);
}

/**
* Null Check Serialization
* @return a Filter for Null-Check Serialization
*/
public static Filter createNull() {
return new Filter().withFormat(FORMAT_NULL);
}

/**
* TypeSave Serialization
* @return a Filter for TypeSave Serialization
*/
public static Filter createTypSave() {
return new Filter().withFormat(FORMAT_TYPESAVE);
}

public void convertProperty(Object entity, String fullProp) {
}
}
Loading

0 comments on commit e18a21f

Please sign in to comment.