001
014
015 package com.liferay.expando.kernel.util;
016
017 import com.liferay.expando.kernel.model.ExpandoBridge;
018 import com.liferay.portal.kernel.service.ServiceContext;
019
020 import java.io.Serializable;
021
022 import java.util.Map;
023
024
028 public class ExpandoBridgeUtil {
029
030 public static void copyExpandoBridgeAttributes(
031 ExpandoBridge oldExpandoBridge, ExpandoBridge newExpandoBridge) {
032
033 newExpandoBridge.setAttributes(
034 oldExpandoBridge.getAttributes(false), false);
035 }
036
037 public static void setExpandoBridgeAttributes(
038 ExpandoBridge oldExpandoBridge, ExpandoBridge newExpandoBridge,
039 ServiceContext serviceContext) {
040
041 Map<String, Serializable> expandoBridgeAttributes =
042 oldExpandoBridge.getAttributes(false);
043
044 expandoBridgeAttributes.putAll(
045 serviceContext.getExpandoBridgeAttributes());
046
047 newExpandoBridge.setAttributes(expandoBridgeAttributes, false);
048 }
049
050 }