Class MResourceType

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_Persistent, I_S_ResourceType, Evaluatee, ImmutablePOSupport

public class MResourceType extends X_S_ResourceType implements ImmutablePOSupport
Resource Type Model
Version:
$Id: MResourceType.java,v 1.2 2006/07/30 00:51:03 jjanke Exp $
Author:
Jorg Janke, Teo Sarca, www.arhipac.ro
  • FR [ 2051056 ] MResource[Type] should be cached
  • added manufacturing related methods (getDayStart, getDayEnd etc)
  • BF [ 2431049 ] If Time Slot then Time Slot Start/End should be mandatory
  • See Also:
    • Constructor Details

      • MResourceType

        public MResourceType(Properties ctx, String S_ResourceType_UU, String trxName)
        UUID based Constructor
        Parameters:
        ctx - Context
        S_ResourceType_UU - UUID key
        trxName - Transaction
      • MResourceType

        public MResourceType(Properties ctx, int S_ResourceType_ID, String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        S_ResourceType_ID - id
      • MResourceType

        public MResourceType(Properties ctx, ResultSet rs, String trxName)
        Load Constructor
        Parameters:
        ctx - context
        rs - result set
      • MResourceType

        public MResourceType(MResourceType copy)
        Copy constructor
        Parameters:
        copy -
      • MResourceType

        public MResourceType(Properties ctx, MResourceType copy)
        Copy constructor
        Parameters:
        ctx -
        copy -
      • MResourceType

        public MResourceType(Properties ctx, MResourceType copy, String trxName)
        Copy constructor
        Parameters:
        ctx -
        copy -
        trxName -
    • Method Details

      • get

        public static MResourceType get(int S_ResourceType_ID)
        Get from Cache (immutable)
        Parameters:
        S_ResourceType_ID -
        Returns:
        MResourceType
      • get

        public static MResourceType get(Properties ctx, int S_ResourceType_ID)
        Get from Cache (immutable)
        Parameters:
        ctx -
        S_ResourceType_ID -
        Returns:
        MResourceType
      • getCopy

        public static MResourceType getCopy(Properties ctx, int S_ResourceType_ID, String trxName)
        Get updateable copy of MResourceType from cache
        Parameters:
        ctx -
        S_ResourceType_ID -
        trxName -
        Returns:
        MResourceType
      • beforeSave

        protected boolean beforeSave(boolean newRecord)
        Description copied from class: PO
        Called before Save for Pre-Save Operation.
        Default implementation is nop, to be implemented in sub-classes that needed it.
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord - true if it is a new record
        Returns:
        true if record can be saved
      • afterSave

        protected boolean afterSave(boolean newRecord, boolean success)
        Description copied from class: PO
        Called after Save for Post-Save Operation.
        Default implementation is nop, to be implemented in sub-classes that needed it.
        Overrides:
        afterSave in class PO
        Parameters:
        newRecord - true if it is a new record
        success - true if save operation was success
        Returns:
        if save was a success
      • getDayStart

        public Timestamp getDayStart(Timestamp date)
        Parameters:
        date -
        Returns:
        day start time stamp
      • getDayEnd

        public Timestamp getDayEnd(Timestamp date)
        Parameters:
        date -
        Returns:
        day end time stamp
      • getDayDurationMillis

        public long getDayDurationMillis()
        Returns:
        duration of a day in millisecond
      • getTimeSlotHours

        public int getTimeSlotHours()
        Get how many hours/day is available. Minutes, seconds and millisecond are discarded.
        Returns:
        available hours
      • getAvailableDaysWeek

        public int getAvailableDaysWeek()
        Get available days / week.
        Returns:
        available days / week
      • isDayAvailable

        public boolean isDayAvailable(Timestamp dateTime)
        Parameters:
        dateTime -
        Returns:
        true if given day is available
      • isAvailable

        public boolean isAvailable()
        Returns:
        true if a resource of this type is generally available (active, at least 1 day available and at least 1 hour available)
      • toString

        public String toString()
        Description copied from class: PO
        String representation
        Overrides:
        toString in class X_S_ResourceType
        Returns:
        String representation
      • markImmutable

        public MResourceType markImmutable()
        Description copied from interface: ImmutablePOSupport
        mark PO as immutable
        Specified by:
        markImmutable in interface ImmutablePOSupport
        Returns:
        PO