/** * Set date/time value. * * @throws NullPointerException if argument is null. */ public void setDateTime(DateTime value) { if (value == null) { throw new NullPointerException("value must not be null"); } dateTimeValue = value; super.setValue(value.toString()); }
/** * Set date/time value. * * @throws NullPointerException if argument is null. */ public void setDateTime(DateTime value) { if (value == null) { throw new NullPointerException("value must not be null"); } dateTimeValue = value; super.setValue(value.toString()); }
@Override protected void putAttributes(AttributeGenerator generator) { generator.setContent(value.toString()); }
@Override protected void putAttributes(AttributeGenerator generator) { generator.setContent(value.toString()); }
@Override protected void putAttributes(AttributeGenerator generator) { generator.setContent(dateDetected.toString()); }
@Override protected void putAttributes(AttributeGenerator generator) { generator.setContent(value.toString()); }
@Override protected void putAttributes(AttributeGenerator generator) { generator.setContent(value.toString()); }
@Override protected void putAttributes(AttributeGenerator generator) { generator.setContent(dateDetected.toString()); }
@Override protected void putAttributes(AttributeGenerator generator) { generator.setContent(value.toString()); }
@Override protected void putAttributes(AttributeGenerator generator) { generator.setContent(value.toString()); }
@Override protected void putAttributes(AttributeGenerator generator) { super.putAttributes(generator); if (date != null) { generator.setContent(date.toString()); } }
@Override protected void putAttributes(AttributeGenerator generator) { super.putAttributes(generator); if (dateTime != null) { generator.setContent(dateTime.toString()); } } }
@Override protected void putAttributes(AttributeGenerator generator) { super.putAttributes(generator); if (dateTime != null) { generator.setContent(dateTime.toString()); } } }
@Override protected void putAttributes(AttributeGenerator generator) { super.putAttributes(generator); if (date != null) { generator.setContent(date.toString()); } }
/** * Adds an attribute of type * {@link com.google.api.gbase.client.GoogleBaseAttributeType#DATE_TIME}. * * This method will never remove an attribute, even if it has * the same name as the new attribute. If you would like to set * an attribute that can only appear once, call * {@link #removeAttributes(String, GoogleBaseAttributeType)} first. * * @param name attribute name * @param dateTime attribute value * @return the attribute object that has been created and added to the item */ public GoogleBaseAttribute addDateTimeAttribute(String name, DateTime dateTime) { return addAttribute(new GoogleBaseAttribute(name, GoogleBaseAttributeType.DATE_TIME, dateTime.toString())); }
/** * Adds an attribute of type * {@link com.google.api.gbase.client.GoogleBaseAttributeType#DATE_TIME}. * * This method will never remove an attribute, even if it has * the same name as the new attribute. If you would like to set * an attribute that can only appear once, call * {@link #removeAttributes(String, GoogleBaseAttributeType)} first. * * @param name attribute name * @param dateTime attribute value * @return the attribute object that has been created and added to the item */ public GoogleBaseAttribute addDateTimeAttribute(String name, DateTime dateTime) { return addAttribute(new GoogleBaseAttribute(name, GoogleBaseAttributeType.DATE_TIME, dateTime.toString())); }
/** * Sets the minimum start time for events returned by the query. Together * with {@link #setMaximumStartTime} creates a timespan such that only events * that are within the timespan are returned. * * @param minStart the minimum start time. A value of {@code null} * disables querying by minimum start time. */ public void setMinimumStartTime(DateTime minStart) { List<CustomParameter> customParams = getCustomParameters(); // Remove any existing minimum start value. for (CustomParameter existingValue : getCustomParameters(MINIMUM_START_TIME)) { customParams.remove(existingValue); } // Add the specified value. if (minStart != null) { customParams.add(new CustomParameter(MINIMUM_START_TIME, minStart.toString())); } }
/** * Sets the maximum start time for events returned by the query. Together * with {@link #setMinimumStartTime} creates a timespan such that only events * that are within the timespan are returned. * * @param maxStart the maximum start time. A value of {@code null} * disables querying by maximum start time. */ public void setMaximumStartTime(DateTime maxStart) { List<CustomParameter> customParams = getCustomParameters(); // Remove any existing maximum start value. for (CustomParameter existingValue : getCustomParameters(MAXIMUM_START_TIME)) { customParams.remove(existingValue); } // Add the specified value. if (maxStart != null) { customParams.add(new CustomParameter(MAXIMUM_START_TIME, maxStart.toString())); } }
/** * Sets the maximum start time for events returned by the query. Together * with {@link #setMinimumStartTime} creates a timespan such that only events * that are within the timespan are returned. * * @param maxStart the maximum start time. A value of {@code null} * disables querying by maximum start time. */ public void setMaximumStartTime(DateTime maxStart) { List<CustomParameter> customParams = getCustomParameters(); // Remove any existing maximum start value. for (CustomParameter existingValue : getCustomParameters(MAXIMUM_START_TIME)) { customParams.remove(existingValue); } // Add the specified value. if (maxStart != null) { customParams.add(new CustomParameter(MAXIMUM_START_TIME, maxStart.toString())); } }
/** * Creates a new hAtom "updated" element for the given entry. */ static XmlElement getUpdatedElement(BaseContentEntry<?> entry) { checkNotNull(entry); XmlElement element = new XmlElement("abbr"); element.setAttribute("class", "updated"); element.setAttribute("title", entry.getUpdated().toString()); DateTime jodaTime = new DateTime(entry.getUpdated().getValue(), DateTimeZone.UTC); element.addText(jodaTime.toString(formatter)); return element; } }