當前位置: 首頁>>代碼示例>>Java>>正文


Java OverwritePolicy類代碼示例

本文整理匯總了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;
}
 
開發者ID:BellaDati,項目名稱:belladati-sdk-java,代碼行數:9,代碼來源:DataSourcePendingImportImpl.java

示例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());
}
 
開發者ID:BellaDati,項目名稱:belladati-sdk-java,代碼行數:8,代碼來源:DataSourcePendingImportTest.java

示例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());
}
 
開發者ID:BellaDati,項目名稱:belladati-sdk-java,代碼行數:10,代碼來源:DataSourcePendingImportTest.java

示例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"));
}
 
開發者ID:BellaDati,項目名稱:belladati-sdk-java,代碼行數:12,代碼來源:DataSourcePendingImportTest.java

示例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"));
}
 
開發者ID:BellaDati,項目名稱:belladati-sdk-java,代碼行數:12,代碼來源:DataSourcePendingImportTest.java

示例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());
}
 
開發者ID:BellaDati,項目名稱:belladati-sdk-java,代碼行數:9,代碼來源:DataSourcePendingImportTest.java

示例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));
}
 
開發者ID:BellaDati,項目名稱:belladati-sdk-java,代碼行數:10,代碼來源:OverwritePolicyTest.java

示例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());
}
 
開發者ID:BellaDati,項目名稱:belladati-sdk-java,代碼行數:8,代碼來源:OverwritePolicyTest.java

示例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");
}
 
開發者ID:BellaDati,項目名稱:belladati-sdk-java,代碼行數:12,代碼來源:OverwritePolicyTest.java

示例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);
}
 
開發者ID:BellaDati,項目名稱:belladati-sdk-java,代碼行數:8,代碼來源:OverwritePolicyTest.java

示例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");
}
 
開發者ID:BellaDati,項目名稱:belladati-sdk-java,代碼行數:15,代碼來源:OverwritePolicyTest.java

示例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"));
}
 
開發者ID:BellaDati,項目名稱:belladati-sdk-java,代碼行數:11,代碼來源:OverwritePolicyTest.java

示例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"));
}
 
開發者ID:BellaDati,項目名稱:belladati-sdk-java,代碼行數:11,代碼來源:OverwritePolicyTest.java

示例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());
}
 
開發者ID:BellaDati,項目名稱:belladati-sdk-java,代碼行數:8,代碼來源:DataSetDataTest.java

示例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());
}
 
開發者ID:BellaDati,項目名稱:belladati-sdk-android,代碼行數:9,代碼來源:DataSourcePendingImportTest.java


注:本文中的com.belladati.sdk.dataset.data.OverwritePolicy類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。