本文整理汇总了Java中net.fortuna.ical4j.model.property.Clazz类的典型用法代码示例。如果您正苦于以下问题:Java Clazz类的具体用法?Java Clazz怎么用?Java Clazz使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Clazz类属于net.fortuna.ical4j.model.property包,在下文中一共展示了Clazz类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createCalendar
import net.fortuna.ical4j.model.property.Clazz; //导入依赖的package包/类
public static Calendar createCalendar(CalDavEvent calDavEvent, DateTimeZone timeZone) {
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
TimeZone timezone = registry.getTimeZone(timeZone.getID());
Calendar calendar = new Calendar();
calendar.getProperties().add(Version.VERSION_2_0);
calendar.getProperties().add(new ProdId("openHAB"));
VEvent vEvent = new VEvent();
vEvent.getProperties().add(new Summary(calDavEvent.getName()));
vEvent.getProperties().add(new Description(calDavEvent.getContent()));
final DtStart dtStart = new DtStart(new net.fortuna.ical4j.model.DateTime(calDavEvent.getStart().toDate()));
dtStart.setTimeZone(timezone);
vEvent.getProperties().add(dtStart);
final DtEnd dtEnd = new DtEnd(new net.fortuna.ical4j.model.DateTime(calDavEvent.getEnd().toDate()));
dtEnd.setTimeZone(timezone);
vEvent.getProperties().add(dtEnd);
vEvent.getProperties().add(new Uid(calDavEvent.getId()));
vEvent.getProperties().add(Clazz.PUBLIC);
vEvent.getProperties()
.add(new LastModified(new net.fortuna.ical4j.model.DateTime(calDavEvent.getLastChanged().toDate())));
calendar.getComponents().add(vEvent);
return calendar;
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:25,代码来源:Util.java
示例2: convertClazzToSensitivity
import net.fortuna.ical4j.model.property.Clazz; //导入依赖的package包/类
@Test
public void convertClazzToSensitivity(){
Set<Clazz> clazzSet = new HashSet<Clazz>();
clazzSet.add(Clazz.CONFIDENTIAL);
clazzSet.add(Clazz.PRIVATE);
clazzSet.add(Clazz.PUBLIC);
clazzSet.add(null);
for(Clazz c : clazzSet){
SensitivityChoicesType sensitivity = ExchangeEventConverterImpl.convertClazzToSensitivityChoicesType(c);
assertNotNull(sensitivity);
if(c == null){
assertEquals(SensitivityChoicesType.PRIVATE, sensitivity);
}else if(c.equals(Clazz.CONFIDENTIAL)){
assertEquals(SensitivityChoicesType.CONFIDENTIAL, sensitivity);
}else if(c.equals(Clazz.PUBLIC)){
assertEquals(SensitivityChoicesType.NORMAL, sensitivity);
}else{
assertEquals(SensitivityChoicesType.PRIVATE, sensitivity);
}
log.info(c +" ==> "+ sensitivity);
}
}
开发者ID:Bedework,项目名称:exchange-ws-client,代码行数:24,代码来源:ExchangeEventConverterImplTest.java
示例3: fromClazz
import net.fortuna.ical4j.model.property.Clazz; //导入依赖的package包/类
protected static String fromClazz(PropertyList propertyList) {
Clazz iCalObj = (Clazz) propertyList.getProperty(Clazz.CLASS);
if (iCalObj == null) {
return null;
}
return "WES_".concat(iCalObj.getValue());
}
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:8,代码来源:ICalConverter.java
示例4: convertClazzToSensitivityChoicesType
import net.fortuna.ical4j.model.property.Clazz; //导入依赖的package包/类
/**
* Return a never null {@link SensitivityChoicesType} for a given {@link Clazz}
*
* Clazz.CONFIDENTIAL => SensitivityChoicesType.CONFIDENTIAL
* Clazz.PUBLIC => SensitivityChoicesType.NORMAL
* All other Clazz => SensitivityChoicesType.PRIVATE
*
* @param clazz
* @return
*/
public static SensitivityChoicesType convertClazzToSensitivityChoicesType(Clazz clazz){
SensitivityChoicesType sensitivity = SensitivityChoicesType.PRIVATE;
if(null != clazz){
if(clazz.equals(Clazz.CONFIDENTIAL)){
sensitivity = SensitivityChoicesType.CONFIDENTIAL;
}else if(clazz.equals(Clazz.PUBLIC)){
sensitivity = SensitivityChoicesType.NORMAL;
}
}
return sensitivity;
}
开发者ID:Bedework,项目名称:exchange-ws-client,代码行数:22,代码来源:ExchangeEventConverterImpl.java
示例5: convertSensitivityToClazz
import net.fortuna.ical4j.model.property.Clazz; //导入依赖的package包/类
@Test
public void convertSensitivityToClazz(){
for(SensitivityChoicesType sct : SensitivityChoicesType.values()){
Clazz clazz = ExchangeEventConverterImpl.convertSensitivityToClazz(sct);
assertNotNull(clazz);
log.info(sct+" ==> "+clazz.getValue());
}
}
开发者ID:Bedework,项目名称:exchange-ws-client,代码行数:9,代码来源:ExchangeEventConverterImplTest.java
示例6: convertNullToClazz
import net.fortuna.ical4j.model.property.Clazz; //导入依赖的package包/类
@Test
public void convertNullToClazz(){
SensitivityChoicesType sct = null;
Clazz clazz = ExchangeEventConverterImpl.convertSensitivityToClazz(sct);
assertNotNull(clazz);
assertEquals(Clazz.PRIVATE, clazz);
log.info(sct+" ==> "+clazz.getValue());
}
开发者ID:Bedework,项目名称:exchange-ws-client,代码行数:9,代码来源:ExchangeEventConverterImplTest.java
示例7: toClazz
import net.fortuna.ical4j.model.property.Clazz; //导入依赖的package包/类
protected static Clazz toClazz(String javaObj) {
if (javaObj == null) {
return null;
}
return new Clazz(javaObj.replace("WES_", ""));
}
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:7,代码来源:ICalConverter.java
示例8: findOrCreateEventCRM
import net.fortuna.ical4j.model.property.Clazz; //导入依赖的package包/类
@Transactional
protected Event findOrCreateEventCRM(VEvent vEvent) {
String uid = vEvent.getUid().getValue();
DtStart dtStart = vEvent.getStartDate();
DtEnd dtEnd = vEvent.getEndDate();
EventRepository repo = Beans.get(EventRepository.class);
Event event = repo.all().filter("self.uid = ?1", uid).fetchOne();
if (event == null) {
event = new Event();
event.setUid(uid);
}
if(event.getTypeSelect() == null || event.getTypeSelect() == 0){
event.setTypeSelect(EventRepository.TYPE_EVENT);
}
event.setStartDateTime(new LocalDateTime(dtStart.getDate()));
event.setEndDateTime(new LocalDateTime(dtEnd.getDate()));
event.setAllDay(!(dtStart.getDate() instanceof DateTime));
event.setSubject(getValue(vEvent, Property.SUMMARY));
event.setDescription(getValue(vEvent, Property.DESCRIPTION));
event.setLocation(getValue(vEvent, Property.LOCATION));
event.setGeo(getValue(vEvent, Property.GEO));
event.setUrl(getValue(vEvent, Property.URL));
event.setSubjectTeam(event.getSubject());
if(Clazz.PRIVATE.getValue().equals(getValue(vEvent, Property.CLASS))){
event.setVisibilitySelect(ICalendarEventRepository.VISIBILITY_PRIVATE);
}
else{
event.setVisibilitySelect(ICalendarEventRepository.VISIBILITY_PUBLIC);
}
if(Transp.TRANSPARENT.getValue().equals(getValue(vEvent, Property.TRANSP))){
event.setDisponibilitySelect(ICalendarEventRepository.DISPONIBILITY_AVAILABLE);
}
else{
event.setDisponibilitySelect(ICalendarEventRepository.DISPONIBILITY_BUSY);
}
if(event.getVisibilitySelect() == ICalendarEventRepository.VISIBILITY_PRIVATE){
event.setSubjectTeam(I18n.get("Available"));
if(event.getDisponibilitySelect() == ICalendarEventRepository.DISPONIBILITY_BUSY){
event.setSubjectTeam(I18n.get("Busy"));
}
}
ICalendarUser organizer = findOrCreateUser(vEvent.getOrganizer(), event);
if (organizer != null) {
event.setOrganizer(organizer);
iCalendarUserRepository.save(organizer);
}
for (Object item : vEvent.getProperties(Property.ATTENDEE)) {
ICalendarUser attendee = findOrCreateUser((Property) item, event);
if (attendee != null) {
event.addAttendee(attendee);
iCalendarUserRepository.save(attendee);
}
}
return event;
}
开发者ID:axelor,项目名称:axelor-business-suite,代码行数:61,代码来源:CalendarService.java
示例9: convertSensitivityToClazz
import net.fortuna.ical4j.model.property.Clazz; //导入依赖的package包/类
/**
* Return a never null {@link Clazz} for a given {@link SensitivityChoicesType}
*
* @see <a href="http://windowsitpro.com/outlook/outlook-using-sensitivity-levels-appointments">Using Sensitivity Levels with Appointments</a>
*
* SensitivityChoicesType.CONFIDENTIAL => Clazz.CONFIDENTIAL
* SensitivityChoicesType.NORMAL => Clazz.PUBLIC
* All other SensitivityChoicesType => Clazz.PRIVATE
*
* @param sensitivity
* @return
*/
public static Clazz convertSensitivityToClazz(SensitivityChoicesType sensitivity){
Clazz clazz = Clazz.PRIVATE;
if(null != sensitivity){
if(sensitivity.equals(SensitivityChoicesType.CONFIDENTIAL)){
clazz = Clazz.CONFIDENTIAL;
}else if(sensitivity.equals(SensitivityChoicesType.NORMAL)){
clazz = Clazz.PUBLIC;
}
}
return clazz;
}
开发者ID:Bedework,项目名称:exchange-ws-client,代码行数:24,代码来源:ExchangeEventConverterImpl.java
注:本文中的net.fortuna.ical4j.model.property.Clazz类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论