Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2014 Philip Helger ( philip[at]helger[dot]com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package com.helger.appbasics.object;
Abstract base class for object related micro type conversion.

Philip Helger
public abstract class AbstractObjectMicroTypeConverter implements IMicroTypeConverter
  private static final String ATTR_ID = "id";
  private static final String ATTR_CREATIONDT = "creationdt";
  private static final String ATTR_CREATIONUSERID = "creationuserid";
  private static final String ATTR_LASTMODDT = "lastmoddt";
  private static final String ATTR_LASTMODUSERID = "lastmoduserid";
  private static final String ATTR_DELETIONDT = "deletiondt";
  private static final String ATTR_DELETIONUSERID = "deletionuserid";
  public static final void setObjectFields (@Nonnull final IObject aValue, @Nonnull final IMicroElement aElement)
    aElement.setAttribute (aValue.getID ());
    aElement.setAttribute (aValue.getCreationUserID ());
    aElement.setAttribute (aValue.getDeletionUserID ());
  public static final StubObject getStubObject (@Nonnull final IMicroElement aElement)
    final String sID = aElement.getAttribute ();
    final DateTime aCreationDT = aElement.getAttributeWithConversion (DateTime.class);
    final String sCreationUserID = aElement.getAttribute ();
    final DateTime aLastModificationDT = aElement.getAttributeWithConversion (DateTime.class);
    final String sLastModificationUserID = aElement.getAttribute ();
    final DateTime aDeletionDT = aElement.getAttributeWithConversion (DateTime.class);
    final String sDeletionUserID = aElement.getAttribute ();
    return new StubObject (sID,
New to GrepCode? Check out our FAQ X