本文整理匯總了Java中com.belladati.sdk.dataset.data.OverwritePolicy類的典型用法代碼示例。如果您正苦於以下問題:Java OverwritePolicy類的具體用法?Java OverwritePolicy怎麽用?Java OverwritePolicy使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
OverwritePolicy類屬於com.belladati.sdk.dataset.data包,在下文中一共展示了OverwritePolicy類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setOverwritePolicy
import com.belladati.sdk.dataset.data.OverwritePolicy; //導入依賴的package包/類
@Override
public DataSourcePendingImport setOverwritePolicy(OverwritePolicy policy) throws IllegalStateException {
if (posted) {
throw new IllegalStateException("Import already submitted to server.");
}
this.overwritePolicy = policy == null ? OverwritePolicy.deleteNone() : policy;
return this;
}
示例2: initialValues
import com.belladati.sdk.dataset.data.OverwritePolicy; //導入依賴的package包/類
/** check initial field values */
public void initialValues() {
setupSource();
assertNull(pending.getRepeatInterval());
assertSame(pending.getOverwritePolicy(), OverwritePolicy.deleteNone());
assertFalse(pending.isOverwriting());
}
示例3: setPolicy
import com.belladati.sdk.dataset.data.OverwritePolicy; //導入依賴的package包/類
/** overwrite policy can be set */
public void setPolicy() {
setupSource();
pending.setOverwritePolicy(OverwritePolicy.byAllAttributes());
assertSame(pending.getOverwritePolicy(), OverwritePolicy.byAllAttributes());
assertTrue(pending.isOverwriting());
assertEquals(pending.toJson().get("overwrite"), OverwritePolicy.byAllAttributes().toJson());
}
示例4: setUnsetPolicy
import com.belladati.sdk.dataset.data.OverwritePolicy; //導入依賴的package包/類
/** policy can be unset after setting */
public void setUnsetPolicy() {
setupSource();
pending.setOverwritePolicy(OverwritePolicy.byAllAttributes());
pending.setOverwritePolicy(OverwritePolicy.deleteNone());
assertSame(pending.getOverwritePolicy(), OverwritePolicy.deleteNone());
assertFalse(pending.isOverwriting());
assertNull(pending.toJson().get("overwrite"));
}
示例5: nullPolicy
import com.belladati.sdk.dataset.data.OverwritePolicy; //導入依賴的package包/類
/** null policy means delete none */
public void nullPolicy() {
setupSource();
pending.setOverwritePolicy(OverwritePolicy.byAllAttributes());
pending.setOverwritePolicy(null);
assertSame(pending.getOverwritePolicy(), OverwritePolicy.deleteNone());
assertFalse(pending.isOverwriting());
assertNull(pending.toJson().get("overwrite"));
}
示例6: setPolicyAfterPost
import com.belladati.sdk.dataset.data.OverwritePolicy; //導入依賴的package包/類
/** can't change policy after posting */
@Test(expectedExceptions = IllegalStateException.class)
public void setPolicyAfterPost() {
server.register(requestUri, "");
setupSource();
pending.post();
pending.setOverwritePolicy(OverwritePolicy.deleteNone());
}
示例7: attributesStrings
import com.belladati.sdk.dataset.data.OverwritePolicy; //導入依賴的package包/類
/** attributes set as strings */
public void attributesStrings() {
String a2 = "a2";
JsonNode json = OverwritePolicy.byAttributes(attribute, a2).toJson();
assertEquals(json.get("policy").asText(), "DELETE_BY_MEMBERS");
assertFalse(json.hasNonNull("attributesAll"));
assertEquals(json.get("attributes"), new ObjectMapper().createArrayNode().add(attribute).add(a2));
}
示例8: attributesList
import com.belladati.sdk.dataset.data.OverwritePolicy; //導入依賴的package包/類
/** attributes set as list */
public void attributesList() {
String a2 = "a2";
assertEquals(OverwritePolicy.byAttributes(Arrays.asList(attribute, a2)).toJson(),
OverwritePolicy.byAttributes(attribute, a2).toJson());
}
示例9: dateFromTo
import com.belladati.sdk.dataset.data.OverwritePolicy; //導入依賴的package包/類
/** date range */
public void dateFromTo() {
Calendar start = new GregorianCalendar(2012, 3, 18);
Calendar end = new GregorianCalendar(2013, 11, 12);
JsonNode json = OverwritePolicy.byDateFromTo(attribute, start, end).toJson();
assertEquals(json.get("policy").asText(), "DELETE_ALL");
assertEquals(json.get("dateAttribute").asText(), attribute);
assertEquals(json.get("dateFrom").asText(), "2012-04-18");
assertEquals(json.get("dateTo").asText(), "2013-12-12");
}
示例10: dateFromBeforeTo
import com.belladati.sdk.dataset.data.OverwritePolicy; //導入依賴的package包/類
/** date range with end before start */
@Test(expectedExceptions = InvalidAbsoluteIntervalException.class)
public void dateFromBeforeTo() {
Calendar start = new GregorianCalendar(2012, 3, 18);
Calendar end = new GregorianCalendar(2012, 3, 17);
OverwritePolicy.byDateFromTo(attribute, start, end);
}
示例11: dateImmutable
import com.belladati.sdk.dataset.data.OverwritePolicy; //導入依賴的package包/類
/** changing the calendar objects doesn't change the interval */
public void dateImmutable() {
Calendar start = new GregorianCalendar(2012, 3, 18);
Calendar end = new GregorianCalendar(2013, 11, 12);
OverwritePolicy policy = OverwritePolicy.byDateFromTo(attribute, start, end);
start.set(Calendar.MONTH, 0);
end.set(Calendar.MONTH, 0);
JsonNode json = policy.toJson();
assertEquals(json.get("dateFrom").asText(), "2012-04-18");
assertEquals(json.get("dateTo").asText(), "2013-12-12");
}
示例12: dateFrom
import com.belladati.sdk.dataset.data.OverwritePolicy; //導入依賴的package包/類
/** all entries from a date */
public void dateFrom() {
Calendar start = new GregorianCalendar(2012, 3, 18);
JsonNode json = OverwritePolicy.byDateFrom(attribute, start).toJson();
assertEquals(json.get("policy").asText(), "DELETE_ALL");
assertEquals(json.get("dateAttribute").asText(), attribute);
assertEquals(json.get("dateFrom").asText(), "2012-04-18");
assertFalse(json.hasNonNull("dateTo"));
}
示例13: dateTo
import com.belladati.sdk.dataset.data.OverwritePolicy; //導入依賴的package包/類
/** all entries before a date */
public void dateTo() {
Calendar end = new GregorianCalendar(2012, 3, 18);
JsonNode json = OverwritePolicy.byDateTo(attribute, end).toJson();
assertEquals(json.get("policy").asText(), "DELETE_ALL");
assertEquals(json.get("dateAttribute").asText(), attribute);
assertEquals(json.get("dateTo").asText(), "2012-04-18");
assertFalse(json.hasNonNull("dateFrom"));
}
示例14: setOverwritePolicy
import com.belladati.sdk.dataset.data.OverwritePolicy; //導入依賴的package包/類
/** overwrite policy can be changed */
public void setOverwritePolicy() {
DataTable table = DataTable.createBasicInstance(column);
table.setOverwritePolicy(OverwritePolicy.deleteAll());
assertNotEquals(table.getOverwritePolicy(), OverwritePolicy.deleteNone());
assertEquals(table.getOverwritePolicy(), OverwritePolicy.deleteAll());
}
示例15: setPolicy
import com.belladati.sdk.dataset.data.OverwritePolicy; //導入依賴的package包/類
/** overwrite policy can be set */
public void setPolicy() {
pending.setOverwritePolicy(OverwritePolicy.byAllAttributes());
assertSame(pending.getOverwritePolicy(), OverwritePolicy.byAllAttributes());
assertTrue(pending.isOverwriting());
assertEquals(pending.toJson().get("overwrite"), OverwritePolicy.byAllAttributes().toJson());
}